From 8b13c5fb2e044a3a317411d597e79d51fce0162c Mon Sep 17 00:00:00 2001 From: Spomky Date: Wed, 1 Jan 2020 23:59:28 +0100 Subject: [PATCH] Global Project update --- composer.json | 13 +++++++------ phpstan.neon | 2 ++ src/ListObject.php | 2 +- src/MapObject.php | 2 +- src/OtherObject/NullObject.php | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 1ea2562..d345035 100644 --- a/composer.json +++ b/composer.json @@ -31,13 +31,14 @@ }, "require-dev": { "php-coveralls/php-coveralls": "^2.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-beberlei-assert": "^0.11.0", - "phpstan/phpstan-deprecation-rules": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-beberlei-assert": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", "phpunit/phpunit": "^7.5|^8.0", - "rector/rector": "^0.5" + "rector/rector": "^0.5|^0.6", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "ext-bcmath": "BCMath extension needed to handle the Big Float and Decimal Fraction Tags" diff --git a/phpstan.neon b/phpstan.neon index f28b512..b1d6e3d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,6 +4,8 @@ parameters: - src ignoreErrors: - '#Method CBOR\\OtherObject\\DoublePrecisionFloatObject::rightShift\(\) should return GMP but returns resource\.#' + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false includes: - vendor/phpstan/phpstan-strict-rules/rules.neon - vendor/phpstan/phpstan-phpunit/extension.neon diff --git a/src/ListObject.php b/src/ListObject.php index c7091bf..f8e6ced 100644 --- a/src/ListObject.php +++ b/src/ListObject.php @@ -35,7 +35,7 @@ class ListObject extends AbstractCBORObject implements \Countable, \IteratorAggr public function __construct(array $data = []) { list($additionalInformation, $length) = LengthCalculator::getLengthOfArray($data); - array_map(function ($item) { + array_map(static function ($item): void { if (!$item instanceof CBORObject) { throw new InvalidArgumentException('The list must contain only CBORObject objects.'); } diff --git a/src/MapObject.php b/src/MapObject.php index 45f145a..1129cc8 100644 --- a/src/MapObject.php +++ b/src/MapObject.php @@ -35,7 +35,7 @@ final class MapObject extends AbstractCBORObject implements \Countable, \Iterato public function __construct(array $data = []) { list($additionalInformation, $length) = LengthCalculator::getLengthOfArray($data); - array_map(function ($item) { + array_map(static function ($item): void { if (!$item instanceof MapItem) { throw new InvalidArgumentException('The list must contain only MapItem objects.'); } diff --git a/src/OtherObject/NullObject.php b/src/OtherObject/NullObject.php index ffbdd91..31635f9 100644 --- a/src/OtherObject/NullObject.php +++ b/src/OtherObject/NullObject.php @@ -32,7 +32,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string return new self(); } - public function getNormalizedData(bool $ignoreTags = false) + public function getNormalizedData(bool $ignoreTags = false): void { } }