Skip to content

Commit

Permalink
PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gnutix committed Jan 10, 2025
1 parent 0cbcdda commit 0f304dc
Show file tree
Hide file tree
Showing 28 changed files with 17,389 additions and 9,793 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
- name: Checkout
Expand Down Expand Up @@ -57,6 +58,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
dependencies:
- "lowest"
- "highest"
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Learn more about it in its [documentation](http://jmsyst.com/libs/serializer/1.x
A fork for modern days [![CI](https://github.com/gammadia/jms-serializer-1.x/actions/workflows/ci.yaml/badge.svg)](https://github.com/gammadia/jms-serializer-1.x/actions/workflows/ci.yaml)
==========

This is a fork of `jms/serializer` at the version `1.14.1` adapted for modern PHP development, which supports :
This is a fork of `jms/serializer` at the version `1.14.1` adapted for more modern PHP development, which supports :

* PHP `7.4` <-> `8.2` (CI green on `8.3-beta`)
* Symfony `3.4` <-> `6.3`
* PHP `7.4` <-> `8.4`
* Symfony `3.4` <-> `7.2`
* Doctrine `2.8` <-> `2.9`

The following changes were backported from more recent versions :
Expand All @@ -27,6 +27,7 @@ The following changes were applied to the dev dependencies :
* `ReadOnly` annotation was renamed to `ReadOnlyProperty` to avoid conflicts with PHP 8.1 readonly reserved keyword
* PHP version bumped to PHP 7.4 to prevent having to deal with PHP's Serializable cross-version compatibility...
* Doctrine dependency bumped from `~2.1` to `^2.8` (because of namespaces changes)
* Doctrine ODM PHPCR support was removed (because they removed classes and I don't know how to replace them)
* Propel support was removed as `propel/propel1` is not working with PHP 8 :

```
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
"jackalope/jackalope-doctrine-dbal": "^1.1.5",
"doctrine/phpcr-odm": "^1.3|^2.0",
"psr/container": "^1.0",
"symfony/dependency-injection": "^3.4|^4.0|^5.0|^6.0",
"symfony/yaml": "^3.4|^4.0|^5.0|^6.0",
"symfony/translation": "^3.4|^4.0|^5.0|^6.0",
"symfony/validator": "^5.4",
"symfony/form": "^3.4|^4.0|^5.0|^6.0",
"symfony/filesystem": "^3.4|^4.0|^5.0|^6.0",
"symfony/expression-language": "^3.4|^4.0|^5.0|^6.0",
"symfony/dependency-injection": "^3.4|^4.0|^5.0|^6.0|^7.0",
"symfony/yaml": "^3.4|^4.0|^5.0|^6.0|^7.0",
"symfony/translation": "^3.4|^4.0|^5.0|^6.0|^7.0",
"symfony/validator": "^5.4|^6.0|^7.0",
"symfony/form": "^3.4|^4.0|^5.0|^6.0|^7.0",
"symfony/filesystem": "^3.4|^4.0|^5.0|^6.0|^7.0",
"symfony/expression-language": "^3.4|^4.0|^5.0|^6.0|^7.0",
"dms/phpunit-arraysubset-asserts": "^0.5",
"phpunit/phpunit": "^9.6",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^2.1",
"overtrue/phplint": "^2.4|^3.0|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0",
"ramsey/uuid-doctrine": "^1.8"
},
Expand Down
16,865 changes: 16,865 additions & 0 deletions phpstan-baseline-php7.4.php

Large diffs are not rendered by default.

317 changes: 317 additions & 0 deletions phpstan-baseline-php8.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
<?php declare(strict_types = 1);

$ignoreErrors = [];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Builder/CallbackDriverFactory.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/EventDispatcher/EventDispatcher.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/EventDispatcher/EventDispatcher.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$class of function class_exists expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/src/JMS/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriber.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriber.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_filter expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Exclusion/GroupsExclusionStrategy.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Exclusion/GroupsExclusionStrategy.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Exclusion/GroupsExclusionStrategy.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/GenericDeserializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/GenericSerializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/GraphNavigator.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/GraphNavigator.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$class of function class_exists expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/GraphNavigator.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$interface of function interface_exists expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/GraphNavigator.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Handler/HandlerRegistry.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/JsonSerializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$flags of function json_encode expects int, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/JsonSerializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_flip expects array\\<int\\|string\\>, array given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/ClassMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/ClassMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function ksort expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/ClassMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function uksort expects TArray of array\\<TKey of int\\|string, T\\>, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/ClassMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/ClassMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/ClassMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/ClassMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 3,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/Driver/XmlDriver.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function strtoupper expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/Driver/XmlDriver.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/Driver/YamlDriver.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$data of function unserialize expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/PropertyMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function ucfirst expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 4,
'path' => __DIR__ . '/src/JMS/Serializer/Metadata/PropertyMetadata.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$directory of function mkdir expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/SerializerBuilder.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_pop expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/Util/Writer.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function rtrim expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/src/JMS/Serializer/Util/Writer.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/src/JMS/Serializer/XmlDeserializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$namespace of method DOMDocument\\:\\:createElementNS\\(\\) expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/src/JMS/Serializer/XmlSerializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$namespace of method DOMElement\\:\\:setAttributeNS\\(\\) expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/src/JMS/Serializer/XmlSerializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function sha1 expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/src/JMS/Serializer/XmlSerializationVisitor.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$keys of function array_combine expects array\\<int\\|string\\>, array given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Fixtures/AccessorSetter.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function strtoupper expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Fixtures/ContextualNamingStrategy.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function ucfirst expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Fixtures/ContextualNamingStrategy.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Fixtures/ObjectWithLifecycleCallbacks.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 4,
'path' => __DIR__ . '/tests/Metadata/ClassMetadataTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function strtoupper expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Metadata/ClassMetadataTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Metadata/Driver/BaseDriverTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Metadata/Driver/YamlDriverTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$class of class ReflectionProperty constructor expects object\\|string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/tests/Serializer/BaseSerializationTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$object of method ReflectionProperty\\:\\:getValue\\(\\) expects object\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Serializer/BaseSerializationTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/tests/Serializer/BaseSerializationTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Serializer/Doctrine/IntegrationTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Serializer/Doctrine/ObjectConstructorTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$string of function ucfirst expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Serializer/JsonSerializationTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$class of class ReflectionProperty constructor expects object\\|string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/SerializerBuilderTest.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$object of method ReflectionProperty\\:\\:getValue\\(\\) expects object\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/SerializerBuilderTest.php',
];

return ['parameters' => ['ignoreErrors' => $ignoreErrors]];
Loading

0 comments on commit 0f304dc

Please sign in to comment.