Skip to content

Commit

Permalink
php min version 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Zogg committed Jan 9, 2021
1 parent e2fedef commit 2cab6a5
Show file tree
Hide file tree
Showing 53 changed files with 147 additions and 410 deletions.
14 changes: 4 additions & 10 deletions .travis.yml
@@ -1,4 +1,4 @@
dist: bionic
dist: focal

language: php

Expand All @@ -11,19 +11,13 @@ git:

matrix:
include:
- php: 7.2
env: composerargs="--prefer-lowest"
- php: 7.2
- php: 7.3
env: composerargs="--prefer-lowest"
- php: 7.3
- php: 7.4
env: composerargs="--prefer-lowest"
- php: 7.4
- php: nightly
# - php: 8.0
# env: composerargs="--prefer-lowest --ignore-platform-reqs"
- php: 8.0
env: composerargs="--ignore-platform-reqs"
allow_failures:
- php: nightly

before_script:
- (phpenv config-rm xdebug.ini || exit 0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -26,7 +26,7 @@ A simple serialization.

## Requirements

* php: ^7.2|^8.0
* php: ^7.4|^8.0
* doctrine/inflector: ^1.0|^2.0
* psr/http-message: ^1.0.1
* psr/link: ^1.0
Expand All @@ -45,7 +45,7 @@ A simple serialization.
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-serialization][1].

```sh
composer require chubbyphp/chubbyphp-serialization "^3.0"
composer require chubbyphp/chubbyphp-serialization "^3.1"
```

## Usage
Expand Down
26 changes: 10 additions & 16 deletions composer.json
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^7.2|^8.0",
"php": "^7.4|^8.0",
"doctrine/inflector": "^1.0|^2.0",
"psr/http-message": "^1.0.1",
"psr/link": "^1.0",
Expand All @@ -20,24 +20,20 @@
"chubbyphp/chubbyphp-container": "^1.1",
"chubbyphp/chubbyphp-dev-helper": "dev-master",
"chubbyphp/chubbyphp-laminas-config-factory": "^1.0",
"chubbyphp/chubbyphp-mock": "^1.4.5",
"chubbyphp/chubbyphp-mock": "^1.6",
"doctrine/persistence": "^1.3|^2.0",
"friendsofphp/php-cs-fixer": "^2.16@dev",
"infection/infection": "^0.15.3|^0.16.6|^0.18.0",
"php-coveralls/php-coveralls": "^2.4.1",
"phploc/phploc": "^5.0|^6.0.2",
"phpstan/extension-installer": "^1.0.5",
"phpstan/phpstan": "^0.12.50",
"phpunit/phpunit": "^8.5.8|^9.4.1",
"infection/infection": "^0.20.2",
"php-coveralls/php-coveralls": "^2.4.3",
"phploc/phploc": "^6.0.2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^0.12.64",
"phpunit/phpunit": "^9.5",
"pimple/pimple": "^3.3",
"psr/container": "^1.0",
"symfony/config": "^3.4.42|^4.4.10|^5.0.10",
"symfony/dependency-injection": "^3.4.42|^4.4.10|^5.0.10",
"symfony/yaml": "^3.4.42|^4.4.10|^5.0.10"
},
"conflict": {
"composer/composer": "<1.10.16"
},
"autoload": {
"psr-4": { "Chubbyphp\\Serialization\\": "src/" }
},
Expand All @@ -49,7 +45,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
},
"scripts": {
Expand All @@ -61,12 +57,10 @@
"@test:infection",
"@test:static-analysis",
"@test:loc",
"@test:cs",
"@test:insights"
"@test:cs"
],
"test:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=86 --verbose --coverage=build/phpunit",
"test:insights": "mkdir -p build && bash -c 'vendor/bin/phpinsights analyse -v --no-interaction --min-quality=94 --disable-security-check | tee build/phpinsights.log; if [ ${PIPESTATUS[0]} -ne \"0\" ]; then exit 1; fi'",
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-result-file=build/phpunit/result.cache",
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",
"test:loc": "mkdir -p build && vendor/bin/phploc src --verbose | tee build/phploc.log",
Expand Down
8 changes: 0 additions & 8 deletions phpinsights.php

This file was deleted.

3 changes: 0 additions & 3 deletions phpstan.neon
Expand Up @@ -12,6 +12,3 @@ parameters:
-
message: '/PHPDoc tag @var for variable \$parentReflectionClass contains generic class ReflectionClass but does not specify its types\: T/'
path: %currentWorkingDirectory%/src/Normalizer/NormalizerObjectMappingRegistry.php
-
message: '/Parameter \#1 \$argument of class ReflectionClass constructor expects class\-string<T of object>\|T of object, string given\./'
path: %currentWorkingDirectory%/src/Normalizer/NormalizerObjectMappingRegistry.php
5 changes: 1 addition & 4 deletions src/Accessor/MethodAccessor.php
Expand Up @@ -8,10 +8,7 @@

final class MethodAccessor implements AccessorInterface
{
/**
* @var string
*/
private $property;
private string $property;

public function __construct(string $property)
{
Expand Down
9 changes: 2 additions & 7 deletions src/Accessor/PropertyAccessor.php
Expand Up @@ -9,10 +9,7 @@

final class PropertyAccessor implements AccessorInterface
{
/**
* @var string
*/
private $property;
private string $property;

public function __construct(string $property)
{
Expand All @@ -31,9 +28,7 @@ public function getValue(object $object)
}

$getter = \Closure::bind(
function ($property) {
return $this->{$property};
},
fn ($property) => $this->{$property},
$object,
$class
);
Expand Down
2 changes: 1 addition & 1 deletion src/Encoder/Encoder.php
Expand Up @@ -11,7 +11,7 @@ final class Encoder implements EncoderInterface
/**
* @var array<string, TypeEncoderInterface>
*/
private $encoderTypes;
private array $encoderTypes;

/**
* @param array<int, TypeEncoderInterface> $encoderTypes
Expand Down
5 changes: 1 addition & 4 deletions src/Encoder/JsonTypeEncoder.php
Expand Up @@ -6,10 +6,7 @@

final class JsonTypeEncoder implements TypeEncoderInterface
{
/**
* @var bool
*/
private $prettyPrint;
private bool $prettyPrint;

public function __construct(bool $prettyPrint = false)
{
Expand Down
5 changes: 1 addition & 4 deletions src/Encoder/JsonxTypeEncoder.php
Expand Up @@ -16,10 +16,7 @@ final class JsonxTypeEncoder implements TypeEncoderInterface
public const DATATYPE_NUMBER = 'number';
public const DATATYPE_NULL = 'null';

/**
* @var bool
*/
private $prettyPrint;
private bool $prettyPrint;

public function __construct(bool $prettyPrint = false)
{
Expand Down
5 changes: 1 addition & 4 deletions src/Encoder/XmlTypeEncoder.php
Expand Up @@ -6,10 +6,7 @@

final class XmlTypeEncoder implements TypeEncoderInterface
{
/**
* @var JsonxTypeEncoder
*/
private $jsonxTypeEncoder;
private JsonxTypeEncoder $jsonxTypeEncoder;

public function __construct(bool $prettyPrint = false)
{
Expand Down
9 changes: 3 additions & 6 deletions src/Link/Link.php
Expand Up @@ -8,20 +8,17 @@

final class Link implements LinkInterface
{
/**
* @var string
*/
private $href;
private string $href;

/**
* @var array<int, string>
*/
private $rels;
private array $rels;

/**
* @var array<string, mixed>
*/
private $attributes;
private array $attributes;

/**
* @param array<int, string> $rels
Expand Down
9 changes: 3 additions & 6 deletions src/Link/LinkBuilder.php
Expand Up @@ -8,20 +8,17 @@

final class LinkBuilder
{
/**
* @var string
*/
private $href;
private ?string $href = null;

/**
* @var array<int, string>
*/
private $rels;
private ?array $rels = null;

/**
* @var array<string, mixed>
*/
private $attributes;
private ?array $attributes = null;

private function __construct()
{
Expand Down
5 changes: 1 addition & 4 deletions src/Mapping/CallableNormalizationObjectMapping.php
Expand Up @@ -6,10 +6,7 @@

final class CallableNormalizationObjectMapping implements NormalizationObjectMappingInterface
{
/**
* @var string
*/
private $class;
private string $class;

/**
* @var callable
Expand Down
15 changes: 3 additions & 12 deletions src/Mapping/LazyNormalizationObjectMapping.php
Expand Up @@ -8,20 +8,11 @@

final class LazyNormalizationObjectMapping implements NormalizationObjectMappingInterface
{
/**
* @var ContainerInterface
*/
private $container;
private ContainerInterface $container;

/**
* @var string
*/
private $serviceId;
private string $serviceId;

/**
* @var string
*/
private $class;
private string $class;

public function __construct(ContainerInterface $container, string $serviceId, string $class)
{
Expand Down
19 changes: 5 additions & 14 deletions src/Mapping/NormalizationFieldMapping.php
Expand Up @@ -10,20 +10,11 @@

final class NormalizationFieldMapping implements NormalizationFieldMappingInterface
{
/**
* @var string
*/
private $name;

/**
* @var FieldNormalizerInterface
*/
private $fieldNormalizer;

/**
* @var PolicyInterface
*/
private $policy;
private string $name;

private FieldNormalizerInterface $fieldNormalizer;

private PolicyInterface $policy;

public function __construct(
string $name,
Expand Down
10 changes: 2 additions & 8 deletions src/Mapping/NormalizationFieldMappingBuilder.php
Expand Up @@ -18,20 +18,14 @@

final class NormalizationFieldMappingBuilder
{
/**
* @var string
*/
private $name;
private string $name;

/**
* @var FieldNormalizerInterface|null
*/
private $fieldNormalizer;

/**
* @var PolicyInterface|null
*/
private $policy;
private ?PolicyInterface $policy = null;

private function __construct(string $name)
{
Expand Down
19 changes: 5 additions & 14 deletions src/Mapping/NormalizationLinkMapping.php
Expand Up @@ -10,20 +10,11 @@

final class NormalizationLinkMapping implements NormalizationLinkMappingInterface
{
/**
* @var string
*/
private $name;

/**
* @var LinkNormalizerInterface
*/
private $linkNormalizer;

/**
* @var PolicyInterface
*/
private $policy;
private string $name;

private LinkNormalizerInterface $linkNormalizer;

private PolicyInterface $policy;

public function __construct(
string $name,
Expand Down
10 changes: 2 additions & 8 deletions src/Mapping/NormalizationLinkMappingBuilder.php
Expand Up @@ -13,20 +13,14 @@

final class NormalizationLinkMappingBuilder
{
/**
* @var string
*/
private $name;
private string $name;

/**
* @var LinkNormalizerInterface
*/
private $linkNormalizer;

/**
* @var PolicyInterface|null
*/
private $policy;
private ?PolicyInterface $policy = null;

private function __construct(string $name)
{
Expand Down

0 comments on commit 2cab6a5

Please sign in to comment.