Skip to content

Commit

Permalink
restore php 7.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Neur0toxine committed Mar 12, 2024
1 parent 18f5b8c commit 759c1ee
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
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:
- name: Check out code into the workspace
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can find more info in the [documentation](doc/index.md).

## Requirements

* PHP 7.4 and above
* PHP 7.3 and above
* PHP's cURL support
* PHP's JSON support
* Any HTTP client compatible with PSR-18 (covered by the installation instructions).
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=7.4",
"php": ">=7.3",
"ext-json": "*",
"psr/log": "^1|^2|^3",
"psr/http-client": "^1.0",
Expand Down Expand Up @@ -67,7 +67,7 @@
"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",
"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-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",
Expand Down
6 changes: 4 additions & 2 deletions src/Component/Serializer/ArraySupportDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
*/
class ArraySupportDecorator implements SerializerInterface
{
private SerializerInterface $serializer;
/** @var \Liip\Serializer\SerializerInterface */
private $serializer;

/**
* ArraySupportDecorator constructor.
Expand Down Expand Up @@ -234,7 +235,8 @@ private static function getArrayValueType(string $type): string
*/
class ArraySupportDecorator implements SerializerInterface
{
private SerializerInterface $serializer;
/** @var \Liip\Serializer\SerializerInterface */
private $serializer;

/**
* ArraySupportDecorator constructor.
Expand Down
18 changes: 12 additions & 6 deletions src/Component/Serializer/Generator/DeserializerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ final class DeserializerGenerator
{
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
Expand Down
20 changes: 14 additions & 6 deletions src/Component/Serializer/Generator/SerializerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,23 @@ final class SerializerGenerator
{
private const FILENAME_PREFIX = 'serialize';

private Filesystem $filesystem;
/** @var \Symfony\Component\Filesystem\Filesystem */
private $filesystem;

private Serialization $templating;
private GeneratorConfiguration $configuration;
private string $cacheDirectory;
/** @var \Liip\Serializer\Template\Serialization */
private $templating;

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(
Serialization $templating,
Expand Down
18 changes: 8 additions & 10 deletions src/Component/Serializer/Parser/JMSCore/Type/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@
*/
final class Parser implements ParserInterface
{
/**
* @var Lexer
*/
private Lexer $lexer;
/** @var \RetailCrm\Api\Component\Serializer\Parser\JMSCore\Type\Lexer */
private $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
*/
private bool $root = true;
/** @var bool */
private $root = true;

public function parse(string $type): array
{
Expand Down
4 changes: 3 additions & 1 deletion src/Component/Serializer/Parser/JMSCore/Type/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ public static function fromObject(object $source): Token
/**
* The position of the token in the input string
*
* @var int
*
* @readonly
*/
public int $position;
public $position;

/**
* @param string|int $value
Expand Down
9 changes: 6 additions & 3 deletions src/Component/Serializer/Parser/JMSParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ class JMSParser implements ModelParserInterface
{
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)
{
Expand Down
8 changes: 3 additions & 5 deletions src/Component/Serializer/Parser/JMSTypeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ final class JMSTypeParser
private const TYPE_ARRAY_COLLECTION = 'ArrayCollection';
private const TYPE_DATETIME_INTERFACE = 'DateTimeInterface';

/**
* @var Parser
*/
private Parser $jmsTypeParser;
/** @var \RetailCrm\Api\Component\Serializer\Parser\JMSCore\Type\Parser */
private $jmsTypeParser;

private $useArrayDateFormat = true;
private $useArrayDateFormat;

public function __construct()
{
Expand Down

0 comments on commit 759c1ee

Please sign in to comment.