1
0
mirror of synced 2024-11-24 06:16:27 +03:00

restore php 7.3 support

This commit is contained in:
Pavel 2024-03-12 09:59:53 +03:00
parent 18f5b8c196
commit 759c1ee5a8
10 changed files with 54 additions and 37 deletions

View File

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3'] php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
steps: steps:
- name: Check out code into the workspace - name: Check out code into the workspace
uses: actions/checkout@v2 uses: actions/checkout@v2

View File

@ -20,7 +20,7 @@ You can find more info in the [documentation](doc/index.md).
## Requirements ## Requirements
* PHP 7.4 and above * PHP 7.3 and above
* PHP's cURL support * PHP's cURL support
* PHP's JSON support * PHP's JSON support
* Any HTTP client compatible with PSR-18 (covered by the installation instructions). * Any HTTP client compatible with PSR-18 (covered by the installation instructions).

View File

@ -16,7 +16,7 @@
} }
], ],
"require": { "require": {
"php": ">=7.4", "php": ">=7.3",
"ext-json": "*", "ext-json": "*",
"psr/log": "^1|^2|^3", "psr/log": "^1|^2|^3",
"psr/http-client": "^1.0", "psr/http-client": "^1.0",
@ -67,7 +67,7 @@
"phpunit": "./vendor/bin/phpunit -c phpunit.xml.dist --coverage-text", "phpunit": "./vendor/bin/phpunit -c phpunit.xml.dist --coverage-text",
"phpunit-ci": "@php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude=\"~vendor~\" ./vendor/bin/phpunit --teamcity -c phpunit.xml.dist", "phpunit-ci": "@php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude=\"~vendor~\" ./vendor/bin/phpunit --teamcity -c phpunit.xml.dist",
"phpmd": "./vendor/bin/phpmd src text ./phpmd.xml", "phpmd": "./vendor/bin/phpmd src text ./phpmd.xml",
"phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.4-8.3 && ./vendor/bin/phpcs -p tests --runtime-set testVersion 7.4-8.3 --warning-severity=0", "phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.3-8.3 && ./vendor/bin/phpcs -p tests --runtime-set testVersion 7.3-8.3 --warning-severity=0",
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon src --memory-limit=-1", "phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon src --memory-limit=-1",
"phpstan-dockerized-ci": "docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/phpstan-ga:1.0.1 analyse src -c phpstan.neon --memory-limit=1G --no-progress", "phpstan-dockerized-ci": "docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/phpstan-ga:1.0.1 analyse src -c phpstan.neon --memory-limit=1G --no-progress",
"lint:fix": "./vendor/bin/phpcbf src", "lint:fix": "./vendor/bin/phpcbf src",

View File

@ -25,7 +25,8 @@ if (PHP_VERSION_ID >= 80000) {
*/ */
class ArraySupportDecorator implements SerializerInterface class ArraySupportDecorator implements SerializerInterface
{ {
private SerializerInterface $serializer; /** @var \Liip\Serializer\SerializerInterface */
private $serializer;
/** /**
* ArraySupportDecorator constructor. * ArraySupportDecorator constructor.
@ -234,7 +235,8 @@ if (PHP_VERSION_ID >= 80000) {
*/ */
class ArraySupportDecorator implements SerializerInterface class ArraySupportDecorator implements SerializerInterface
{ {
private SerializerInterface $serializer; /** @var \Liip\Serializer\SerializerInterface */
private $serializer;
/** /**
* ArraySupportDecorator constructor. * ArraySupportDecorator constructor.

View File

@ -29,17 +29,23 @@ final class DeserializerGenerator
{ {
private const FILENAME_PREFIX = 'deserialize'; private const FILENAME_PREFIX = 'deserialize';
private Filesystem $filesystem; /** @var \Symfony\Component\Filesystem\Filesystem */
private $filesystem;
private GeneratorConfiguration $configuration; /** @var \Liip\Serializer\Configuration\GeneratorConfiguration */
private $configuration;
private Deserialization $templating; /** @var \Liip\Serializer\Template\Deserialization */
private $templating;
private CustomDeserialization $customTemplating; /** @var \RetailCrm\Api\Component\Serializer\Template\CustomDeserialization */
private $customTemplating;
private string $cacheDirectory; /** @var string */
private $cacheDirectory;
private Builder $metadataBuilder; /** @var \Liip\MetadataParser\Builder */
private $metadataBuilder;
/** /**
* @param list<class-string> $classesToGenerate This is a list of FQCN classnames * @param list<class-string> $classesToGenerate This is a list of FQCN classnames

View File

@ -33,15 +33,23 @@ final class SerializerGenerator
{ {
private const FILENAME_PREFIX = 'serialize'; private const FILENAME_PREFIX = 'serialize';
private Filesystem $filesystem; /** @var \Symfony\Component\Filesystem\Filesystem */
private $filesystem;
private Serialization $templating; /** @var \Liip\Serializer\Template\Serialization */
private GeneratorConfiguration $configuration; private $templating;
private string $cacheDirectory;
private CustomSerialization $customTemplating; /** @var \Liip\Serializer\Configuration\GeneratorConfiguration */
private $configuration;
private Builder $metadataBuilder; /** @var string */
private $cacheDirectory;
/** @var \RetailCrm\Api\Component\Serializer\Template\CustomSerialization */
private $customTemplating;
/** @var \Liip\MetadataParser\Builder */
private $metadataBuilder;
public function __construct( public function __construct(
Serialization $templating, Serialization $templating,

View File

@ -11,19 +11,17 @@ use RetailCrm\Api\Component\Serializer\Parser\JMSCore\Type\Exception\SyntaxError
*/ */
final class Parser implements ParserInterface final class Parser implements ParserInterface
{ {
/** /** @var \RetailCrm\Api\Component\Serializer\Parser\JMSCore\Type\Lexer */
* @var Lexer private $lexer;
*/
private Lexer $lexer;
private ?Token $token = null; /** @var \RetailCrm\Api\Component\Serializer\Parser\JMSCore\Type\Token|null */
private $token = null;
private string $input; /** @var string */
private $input;
/** /** @var bool */
* @var bool private $root = true;
*/
private bool $root = true;
public function parse(string $type): array public function parse(string $type): array
{ {

View File

@ -41,9 +41,11 @@ final class Token
/** /**
* The position of the token in the input string * The position of the token in the input string
* *
* @var int
*
* @readonly * @readonly
*/ */
public int $position; public $position;
/** /**
* @param string|int $value * @param string|int $value

View File

@ -41,11 +41,14 @@ class JMSParser implements ModelParserInterface
{ {
private const ACCESS_ORDER_CUSTOM = 'custom'; private const ACCESS_ORDER_CUSTOM = 'custom';
private Reader $annotationsReader; /** @var \Doctrine\Common\Annotations\Reader */
private $annotationsReader;
private PhpTypeParser $phpTypeParser; /** @var \Liip\MetadataParser\TypeParser\PhpTypeParser */
private $phpTypeParser;
protected JMSTypeParser $jmsTypeParser; /** @var \RetailCrm\Api\Component\Serializer\Parser\JMSTypeParser */
protected $jmsTypeParser;
public function __construct(Reader $annotationsReader) public function __construct(Reader $annotationsReader)
{ {

View File

@ -25,12 +25,10 @@ final class JMSTypeParser
private const TYPE_ARRAY_COLLECTION = 'ArrayCollection'; private const TYPE_ARRAY_COLLECTION = 'ArrayCollection';
private const TYPE_DATETIME_INTERFACE = 'DateTimeInterface'; private const TYPE_DATETIME_INTERFACE = 'DateTimeInterface';
/** /** @var \RetailCrm\Api\Component\Serializer\Parser\JMSCore\Type\Parser */
* @var Parser private $jmsTypeParser;
*/
private Parser $jmsTypeParser;
private $useArrayDateFormat = true; private $useArrayDateFormat;
public function __construct() public function __construct()
{ {