diff --git a/README.md b/README.md index f66d907..19e3c02 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ CBOR for PHP ============ -![Build Status](https://github.com/Spomky-Labs/cbor-php/workflows/Unit%20and%20Functional%20Tests/badge.svg) -![Build Status](https://github.com/Spomky-Labs/cbor-php/workflows/Mutation%20Testing/badge.svg) - -![Coding Standards](https://github.com/Spomky-Labs/cbor-php/workflows/Coding%20Standards/badge.svg) -![Static Analyze](https://github.com/Spomky-Labs/cbor-php/workflows/Static%20Analyze/badge.svg) +![Build Status](https://github.com/Spomky-Labs/cbor-php/workflows/Integrate/badge.svg) [![Latest Stable Version](https://poser.pugx.org/Spomky-Labs/cbor-php/v)](//packagist.org/packages/Spomky-Labs/cbor-php) [![Total Downloads](https://poser.pugx.org/Spomky-Labs/cbor-php/downloads)](//packagist.org/packages/Spomky-Labs/cbor-php) diff --git a/composer.json b/composer.json index 1630e91..b8d7642 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ }, "require-dev": { "ext-json": "*", - "ekino/phpstan-banned-code": "^1.0 || ^2.0", + "ekino/phpstan-banned-code": "^2.0", "infection/infection": "^0.29", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8de4af4..42358f2 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,36 +1,56 @@ parameters: - ignoreErrors: - - - message: "#^Instanceof between CBOR\\\\MapItem and CBOR\\\\MapItem will always evaluate to true\\.$#" - count: 1 - path: src/MapObject.php - - - - message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToBigInteger\\(\\) expects string, string\\|null given\\.$#" - count: 3 - path: src/OtherObject/DoublePrecisionFloatObject.php - - - - message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToBigInteger\\(\\) expects string, string\\|null given\\.$#" - count: 3 - path: src/OtherObject/HalfPrecisionFloatObject.php - - - - message: "#^PHPDoc tag @var with type CBOR\\\\OtherObject is not subtype of native type string\\.$#" - count: 1 - path: src/OtherObject/OtherObjectManager.php - - - - message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToBigInteger\\(\\) expects string, string\\|null given\\.$#" - count: 3 - path: src/OtherObject/SinglePrecisionFloatObject.php - - - - message: "#^PHPDoc tag @var with type CBOR\\\\Tag is not subtype of native type string\\.$#" - count: 1 - path: src/Tag/TagManager.php - - - - message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToInt\\(\\) expects string, string\\|null given\\.$#" - count: 1 - path: src/Tag/TagManager.php + ignoreErrors: + - + message: "#^Instanceof between CBOR\\\\MapItem and CBOR\\\\MapItem will always evaluate to true\\.$#" + count: 1 + path: src/MapObject.php + + - + message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToBigInteger\\(\\) expects string, string\\|null given\\.$#" + count: 3 + path: src/OtherObject/DoublePrecisionFloatObject.php + + - + message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToBigInteger\\(\\) expects string, string\\|null given\\.$#" + count: 3 + path: src/OtherObject/HalfPrecisionFloatObject.php + + - + message: "#^PHPDoc tag @var with type CBOR\\\\OtherObject is not subtype of native type string\\.$#" + count: 1 + path: src/OtherObject/OtherObjectManager.php + + - + message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToBigInteger\\(\\) expects string, string\\|null given\\.$#" + count: 3 + path: src/OtherObject/SinglePrecisionFloatObject.php + + - + message: "#^Parameter \\#1 \\$num1 of function bcmul expects numeric\\-string, string given\\.$#" + count: 1 + path: src/Tag/BigFloatTag.php + + - + message: "#^Parameter \\#2 \\$exponent of function bcpow expects numeric\\-string, string given\\.$#" + count: 1 + path: src/Tag/BigFloatTag.php + + - + message: "#^Parameter \\#1 \\$num1 of function bcmul expects numeric\\-string, string given\\.$#" + count: 1 + path: src/Tag/DecimalFractionTag.php + + - + message: "#^Parameter \\#2 \\$exponent of function bcpow expects numeric\\-string, string given\\.$#" + count: 1 + path: src/Tag/DecimalFractionTag.php + + - + message: "#^PHPDoc tag @var with type CBOR\\\\Tag is not subtype of native type string\\.$#" + count: 1 + path: src/Tag/TagManager.php + + - + message: "#^Parameter \\#1 \\$value of static method CBOR\\\\Utils\\:\\:binToInt\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: src/Tag/TagManager.php diff --git a/src/Decoder.php b/src/Decoder.php index 2e8fd20..4f3c273 100644 --- a/src/Decoder.php +++ b/src/Decoder.php @@ -35,6 +35,7 @@ use InvalidArgumentException; use RuntimeException; use function ord; +use function sprintf; use const STR_PAD_LEFT; final class Decoder implements DecoderInterface diff --git a/src/StringStream.php b/src/StringStream.php index 82267f6..a6858e0 100644 --- a/src/StringStream.php +++ b/src/StringStream.php @@ -6,6 +6,7 @@ use InvalidArgumentException; use RuntimeException; +use function sprintf; use function strlen; final class StringStream implements Stream