Skip to content

Commit c53edee

Browse files
authored
Merge pull request #218 from kayw-geek/feature/fix-implicitly-nullable-parameter
Introduce Rector to fix implicitly nullable parameter warnings
2 parents 9a1300f + 3750f2a commit c53edee

38 files changed

+82
-67
lines changed

.github/workflows/phpunit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php-versions: [ "7.4", "8.0", "8.1" ]
11+
php-versions: [ "7.4", "8.0", "8.4" ]
1212
phpunit-versions: [ "9" ]
1313
steps:
1414
- uses: actions/checkout@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/psalm.phar
77
.phpunit.result.cache
88
.php-cs-fixer.cache
9+
/rector-cache

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based now on [Keep a
55
Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to
66
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [4.2.1]
9+
- Introduce Rector to fix implicitly nullable parameter warnings.
10+
- Thanks to @kayw-geek for the contribution.
11+
812
## [4.2.0]
913
- Added [multi-page document conversion](https://uploadcare.com/docs/transformations/document-conversion/#multipage-conversion).
1014
- Added [Unsafe content detection](https://uploadcare.com/docs/unsafe-content/).
@@ -42,7 +46,7 @@ Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to
4246
### Removed
4347
- PHP 7.1 support (now minimal version is 7.4, PHP 8.0 is also supported)
4448
- `FileInfoInterface::getImageInfo()`, `FileInfoInterface::getVideoInfo()`, `FileInfoInterface::getRekognitionInfo()` — see `FileInfoInterface::getContentInfo()`
45-
### Added
49+
### Added
4650
- Support for [REST API 0.7](https://uploadcare.com/api-refs/rest-api/v0.7.0/)
4751
- `FileInfoInterface::getContentInfo()`: returns `ContentInfoInterface` with `getMime()` (information about MimeType), `getImage` (`ImageInfoInterface` in case of an image) and `getVideo` (`VideoInfoInterface` in case of a video) methods;
4852
- `FileInfoInterface::getMetadata()` method returns file associated metadata array-accessible object;
@@ -105,7 +109,7 @@ Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to
105109
### Fix
106110
- Added support for guzzlehttp/guzzle:^7.
107111

108-
## [3.0.0]
112+
## [3.0.0]
109113
### BREAKING CHANGES
110114
- You must update PHP to 5.6 or a newer version.
111115
- This **completely new** version **is not** backward compatibile with the

api-samples/rest-api/delete-files-storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
$fileInfo = $api->fileInfo('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
66
$api->deleteFile($fileInfo);
77

8-
echo \sprintf('File \'%s\' deleted at \'%s\'', $fileInfo->getUuid(), $fileInfo->getDatetimeRemoved()->format(\DateTimeInterface::ATOM));
8+
echo \sprintf('File \'%s\' deleted at \'%s\'', $fileInfo->getUuid(), $fileInfo->getDatetimeRemoved()->format(DateTimeInterface::ATOM));

api-samples/rest-api/delete-files-uuid-metadata-key.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$metadataApi = (new Uploadcare\Api($configuration))->metadata();
55
try {
66
$metadataApi->removeKey('1bac376c-aa7e-4356-861b-dd2657b5bfd2', 'pet');
7-
} catch (\Throwable $e) {
7+
} catch (Throwable $e) {
88
echo \sprintf('Error while key removing: %s', $e->getMessage());
99
}
1010
echo 'Key was successfully removed';

api-samples/rest-api/delete-files-uuid-storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);
44
$fileInfo = (new Uploadcare\Api($configuration))->file()->deleteFile('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
5-
echo \sprintf('File \'%s\' deleted at \'%s\'', $fileInfo->getUuid(), $fileInfo->getDatetimeRemoved()->format(\DateTimeInterface::ATOM));
5+
echo \sprintf('File \'%s\' deleted at \'%s\'', $fileInfo->getUuid(), $fileInfo->getDatetimeRemoved()->format(DateTimeInterface::ATOM));

api-samples/rest-api/delete-groups-uuid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$api = (new Uploadcare\Api($configuration))->group();
55
try {
66
$api->removeGroup('c5bec8c7-d4b6-4921-9e55-6edb027546bc~1');
7-
} catch (\Throwable $e) {
7+
} catch (Throwable $e) {
88
echo \sprintf('Error while group deletion: %s', $e->getMessage());
99
}
1010
echo 'Group successfully deleted';

api-samples/rest-api/put-files-storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
continue;
1313
}
1414

15-
\sprintf('Result %s is stored at %s', $result->getUuid(), $result->getDatetimeStored()->format(\DateTimeInterface::ATOM));
15+
\printf('Result %s is stored at %s', $result->getUuid(), $result->getDatetimeStored()->format(DateTimeInterface::ATOM));
1616
}

api-samples/rest-api/put-files-uuid-storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
$api = (new Uploadcare\Api($configuration))->file();
55
$result = $api->storeFile('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
66

7-
echo \sprintf('File %s is stored at %s', $result->getUuid(), $result->getDatetimeStored()->format(\DateTimeInterface::ATOM));
7+
echo \sprintf('File %s is stored at %s', $result->getUuid(), $result->getDatetimeStored()->format(DateTimeInterface::ATOM));

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"fakerphp/faker": "^1.20",
3737
"friendsofphp/php-cs-fixer": "^3.11",
3838
"phpunit/phpunit": "^9.5",
39+
"rector/rector": "^2.1",
40+
"symfony/string": "^6.4",
3941
"symfony/dotenv": "^5.4",
4042
"symfony/var-dumper": "^5.4",
4143
"vimeo/psalm": "^4.27"

0 commit comments

Comments
 (0)