Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PHP 8.4 compatibility #33

Merged
merged 6 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php: [ '8.1', '8.2', '8.3' ]
symfony: [ '6.*' ]
php: [ '8.1', '8.2', '8.3', '8.4' ]
symfony: [ '6.*', '7.*' ]
dep: [highest,lowest]
exclude:
# Symfony 7 requires PHP >=8.2
- php: '8.1'
symfony: '7.*'

runs-on: ${{ matrix.operating-system }}

Expand Down Expand Up @@ -55,6 +59,7 @@ jobs:

- name: Run psalm
run: vendor/bin/psalm
if: matrix.dep == 'highest'

- name: Run phpstan
run: vendor/bin/phpstan analyse
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.9.0

* feat: PHP 8.4 compatibility

## 1.8.10

* chore: add and set rector
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"ekino/phpstan-banned-code": "^2.1",
"league/flysystem-memory": "^3.16",
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^1.10.50",
"phpstan/phpstan": "1.12.2 || ^1.12.4 || ^1.13",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
Expand All @@ -69,7 +69,7 @@
"symfony/routing": "^6.2 || ^7.0",
"symfony/yaml": "^6.2 || ^7.0",
"symplify/monorepo-builder": "^11.2.20 || ^11.3",
"vimeo/psalm": "^5.18",
"vimeo/psalm": "^5.26",
"rector/rector": "^1.2"
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ChainedObjectNotSupportedException extends FileLocationResolverException
public function __construct(
object $object,
private readonly iterable $exceptions,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
\Exception::__construct(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
string $class,
object $object,
string $message,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
parent::__construct(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ChainedObjectIdResolverException extends ObjectIdResolverException
public function __construct(
object $object,
private readonly iterable $exceptions,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
\Exception::__construct(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EmptyIdException extends ObjectIdResolverException
public function __construct(
object $object,
string $method,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
parent::__construct(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(
object $object,
string $method,
mixed $id,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
parent::__construct(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MethodNotFoundException extends ObjectIdResolverException
public function __construct(
object $object,
string $method,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
parent::__construct(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ObjectNotSupportedException extends ObjectIdResolverException
{
public function __construct(
object $object,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
parent::__construct(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PropertyReaderException extends FileAssociationException
public function __construct(
object $object,
string $property,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
$message = \sprintf('Unable to read property "%s" in object "%s"', $property, get_debug_type($object));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
object|array $object,
string $property,
mixed $value,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
$message = \sprintf('Unable to write "%s" to property "%s" in object "%s"', get_debug_type($value), $property, get_debug_type($object));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FileNotFoundException extends FileException
public function __construct(
string $key,
?string $filesystemId = null,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
if ($filesystemId !== null) {
parent::__construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TemporaryFileException extends FileException
public function __construct(
string $prefix,
?string $filesystemId = null,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
if ($filesystemId !== null) {
parent::__construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AdHocFilesystemException extends FileRepositoryException
{
public function __construct(
FileInterface $file,
\Throwable $previous = null,
?\Throwable $previous = null,
) {
parent::__construct(\sprintf(
'File with key "%s" has an ad-hoc filesystem "%s", but the function you are using in the file repository is unable work with such a file.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class MetadataNotFoundException extends \Exception
{
public function __construct(string $metadataName, \Throwable $previous = null)
public function __construct(string $metadataName, ?\Throwable $previous = null)
{
parent::__construct(
\sprintf('Metadata "%s" is not found', $metadataName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function getMimeType(): ?string
}

#[\Override]
public function move(string $directory, string $name = null): self
public function move(string $directory, ?string $name = null): self
{
$this->getHttpFoundationFile()->move($directory, $name);

Expand Down
8 changes: 4 additions & 4 deletions packages/file/src/TemporaryFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __destruct()
* Creates a temporary file in the local filesystem
*/
final public static function create(
string $prefix = null,
?string $prefix = null,
): self {
$prefix ??= 'temporaryfile-';
$path = tempnam(sys_get_temp_dir(), $prefix);
Expand All @@ -55,7 +55,7 @@ final public static function create(
*/
final public static function createFromString(
string $content,
string $prefix = null,
?string $prefix = null,
): self {
$file = self::create($prefix);
$file->setContent($content);
Expand All @@ -65,8 +65,8 @@ final public static function createFromString(

final public static function createFromExisting(
string $key,
FilesystemOperator $filesystem = null,
string $filesystemIdentifier = null,
?FilesystemOperator $filesystem = null,
?string $filesystemIdentifier = null,
): self {
$file = new self($key, $filesystem, $filesystemIdentifier);
$file->setName(null);
Expand Down
Loading