diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php
similarity index 94%
rename from .php_cs.dist
rename to .php-cs-fixer.dist.php
index 513f2fd..35e1266 100644
--- a/.php_cs.dist
+++ b/.php-cs-fixer.dist.php
@@ -6,7 +6,7 @@
->exclude('vendor')
->in(__DIR__);
-return PhpCsFixer\Config::create()
+return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setUsingCache(false)
->setRules(
@@ -28,7 +28,7 @@
'dir_constant' => true,
'modernize_types_casting' => true,
'php_unit_construct' => true,
- 'psr4' => true,
+ 'psr_autoloading' => true,
'final_internal_class' => true,
'php_unit_strict' => [
'assertions' => [
@@ -44,7 +44,7 @@
'date_time_immutable' => true,
'general_phpdoc_annotation_remove' => true,
'mb_str_functions' => true,
- 'no_multiline_whitespace_before_semicolons' => true,
+ 'multiline_whitespace_before_semicolons' => true,
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
diff --git a/README.md b/README.md
index 4f034e2..1371803 100644
--- a/README.md
+++ b/README.md
@@ -47,4 +47,5 @@ A script called dev.sh can be used to manage the image. Here are the avaliable c
executes qc tests
- ./dev.sh install
+
executes composer install --optimize-autoloader
diff --git a/composer.json b/composer.json
index a6cf531..5245e21 100644
--- a/composer.json
+++ b/composer.json
@@ -7,13 +7,14 @@
"beberlei/assert": "^3.3"
},
"require-dev": {
- "friendsofphp/php-cs-fixer": "^2.18",
- "phpstan/phpstan-phpunit": "^0.12.17",
- "phpstan/phpstan": "^0.12.76",
+ "friendsofphp/php-cs-fixer": "^v3.35.1",
+ "phpstan/phpstan-phpunit": "^1.3.15",
+ "phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^9.5",
- "phpstan/extension-installer": "^1.1",
- "phpstan/phpstan-beberlei-assert": "^0.12.6",
- "ekino/phpstan-banned-code": "0.10.x-dev"
+ "phpstan/extension-installer": "^1.3.1",
+ "phpstan/phpstan-beberlei-assert": "^1.1.2",
+ "ekino/phpstan-banned-code": "v1.0.0",
+ "vimeo/psalm": "^5.15"
},
"autoload": {
"psr-4": {
@@ -40,5 +41,10 @@
"@phpstan",
"@test"
]
+ },
+ "config": {
+ "allow-plugins": {
+ "phpstan/extension-installer": true
+ }
}
}
diff --git a/composer.lock b/composer.lock
index de10fb3..003238b 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,25 +4,24 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "6c6e2a87b1a9c7c11a1f42c2ed0911a3",
+ "content-hash": "d99976eb589a2fd272f1269e1405c30a",
"packages": [
{
"name": "beberlei/assert",
- "version": "v3.3.0",
+ "version": "v3.3.2",
"source": {
"type": "git",
"url": "https://github.com/beberlei/assert.git",
- "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab"
+ "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/beberlei/assert/zipball/5367e3895976b49704ae671f75bc5f0ba1b986ab",
- "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab",
+ "url": "https://api.github.com/repos/beberlei/assert/zipball/cb70015c04be1baee6f5f5c953703347c0ac1655",
+ "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655",
"shasum": ""
},
"require": {
"ext-ctype": "*",
- "ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
@@ -34,14 +33,17 @@
"phpunit/phpunit": ">=6.0.0",
"yoast/phpunit-polyfills": "^0.1.0"
},
+ "suggest": {
+ "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles"
+ },
"type": "library",
"autoload": {
- "psr-4": {
- "Assert\\": "lib/Assert"
- },
"files": [
"lib/Assert/functions.php"
- ]
+ ],
+ "psr-4": {
+ "Assert\\": "lib/Assert"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -67,31 +69,268 @@
],
"support": {
"issues": "https://github.com/beberlei/assert/issues",
- "source": "https://github.com/beberlei/assert/tree/v3.3.0"
+ "source": "https://github.com/beberlei/assert/tree/v3.3.2"
},
- "time": "2020-11-13T20:02:54+00:00"
+ "time": "2021-12-16T21:41:27+00:00"
}
],
"packages-dev": [
+ {
+ "name": "amphp/amp",
+ "version": "v2.6.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/amphp/amp.git",
+ "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
+ "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "require-dev": {
+ "amphp/php-cs-fixer-config": "dev-master",
+ "amphp/phpunit-util": "^1",
+ "ext-json": "*",
+ "jetbrains/phpstorm-stubs": "^2019.3",
+ "phpunit/phpunit": "^7 | ^8 | ^9",
+ "psalm/phar": "^3.11@dev",
+ "react/promise": "^2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.x-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "lib/functions.php",
+ "lib/Internal/functions.php"
+ ],
+ "psr-4": {
+ "Amp\\": "lib"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Daniel Lowrey",
+ "email": "rdlowrey@php.net"
+ },
+ {
+ "name": "Aaron Piotrowski",
+ "email": "aaron@trowski.com"
+ },
+ {
+ "name": "Bob Weinand",
+ "email": "bobwei9@hotmail.com"
+ },
+ {
+ "name": "Niklas Keller",
+ "email": "me@kelunik.com"
+ }
+ ],
+ "description": "A non-blocking concurrency framework for PHP applications.",
+ "homepage": "https://amphp.org/amp",
+ "keywords": [
+ "async",
+ "asynchronous",
+ "awaitable",
+ "concurrency",
+ "event",
+ "event-loop",
+ "future",
+ "non-blocking",
+ "promise"
+ ],
+ "support": {
+ "irc": "irc://irc.freenode.org/amphp",
+ "issues": "https://github.com/amphp/amp/issues",
+ "source": "https://github.com/amphp/amp/tree/v2.6.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/amphp",
+ "type": "github"
+ }
+ ],
+ "time": "2022-02-20T17:52:18+00:00"
+ },
+ {
+ "name": "amphp/byte-stream",
+ "version": "v1.8.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/amphp/byte-stream.git",
+ "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd",
+ "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd",
+ "shasum": ""
+ },
+ "require": {
+ "amphp/amp": "^2",
+ "php": ">=7.1"
+ },
+ "require-dev": {
+ "amphp/php-cs-fixer-config": "dev-master",
+ "amphp/phpunit-util": "^1.4",
+ "friendsofphp/php-cs-fixer": "^2.3",
+ "jetbrains/phpstorm-stubs": "^2019.3",
+ "phpunit/phpunit": "^6 || ^7 || ^8",
+ "psalm/phar": "^3.11.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "lib/functions.php"
+ ],
+ "psr-4": {
+ "Amp\\ByteStream\\": "lib"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Aaron Piotrowski",
+ "email": "aaron@trowski.com"
+ },
+ {
+ "name": "Niklas Keller",
+ "email": "me@kelunik.com"
+ }
+ ],
+ "description": "A stream abstraction to make working with non-blocking I/O simple.",
+ "homepage": "http://amphp.org/byte-stream",
+ "keywords": [
+ "amp",
+ "amphp",
+ "async",
+ "io",
+ "non-blocking",
+ "stream"
+ ],
+ "support": {
+ "irc": "irc://irc.freenode.org/amphp",
+ "issues": "https://github.com/amphp/byte-stream/issues",
+ "source": "https://github.com/amphp/byte-stream/tree/v1.8.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/amphp",
+ "type": "github"
+ }
+ ],
+ "time": "2021-03-30T17:13:30+00:00"
+ },
+ {
+ "name": "composer/pcre",
+ "version": "3.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9",
+ "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.3",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "symfony/phpunit-bridge": "^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/3.1.1"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-10-11T07:11:09+00:00"
+ },
{
"name": "composer/semver",
- "version": "3.2.4",
+ "version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464"
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464",
- "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464",
+ "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpstan/phpstan": "^0.12.54",
+ "phpstan/phpstan": "^1.4",
"symfony/phpunit-bridge": "^4.2 || ^5"
},
"type": "library",
@@ -134,9 +373,9 @@
"versioning"
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
- "source": "https://github.com/composer/semver/tree/3.2.4"
+ "source": "https://github.com/composer/semver/tree/3.4.0"
},
"funding": [
{
@@ -152,28 +391,31 @@
"type": "tidelift"
}
],
- "time": "2020-11-13T08:59:24+00:00"
+ "time": "2023-08-31T09:50:34+00:00"
},
{
"name": "composer/xdebug-handler",
- "version": "1.4.5",
+ "version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
- "reference": "f28d44c286812c714741478d968104c5e604a1d4"
+ "reference": "ced299686f41dce890debac69273b47ffe98a40c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4",
- "reference": "f28d44c286812c714741478d968104c5e604a1d4",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c",
+ "reference": "ced299686f41dce890debac69273b47ffe98a40c",
"shasum": ""
},
"require": {
- "php": "^5.3.2 || ^7.0 || ^8.0",
- "psr/log": "^1.0"
+ "composer/pcre": "^1 || ^2 || ^3",
+ "php": "^7.2.5 || ^8.0",
+ "psr/log": "^1 || ^2 || ^3"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8"
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "symfony/phpunit-bridge": "^6.0"
},
"type": "library",
"autoload": {
@@ -199,7 +441,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
- "source": "https://github.com/composer/xdebug-handler/tree/1.4.5"
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.3"
},
"funding": [
{
@@ -215,103 +457,118 @@
"type": "tidelift"
}
],
- "time": "2020-11-13T08:04:11+00:00"
+ "time": "2022-02-25T21:32:43+00:00"
},
{
- "name": "doctrine/annotations",
- "version": "1.12.0",
+ "name": "dnoegel/php-xdg-base-dir",
+ "version": "v0.1.1",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/annotations.git",
- "reference": "ebec9b1708c95d7602245c8172773f6b4e0c3be1"
+ "url": "https://github.com/dnoegel/php-xdg-base-dir.git",
+ "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/ebec9b1708c95d7602245c8172773f6b4e0c3be1",
- "reference": "ebec9b1708c95d7602245c8172773f6b4e0c3be1",
+ "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd",
+ "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd",
"shasum": ""
},
"require": {
- "doctrine/lexer": "1.*",
- "ext-tokenizer": "*",
- "php": "^7.1 || ^8.0"
+ "php": ">=5.3.2"
},
"require-dev": {
- "doctrine/cache": "1.*",
- "doctrine/coding-standard": "^6.0 || ^8.1",
- "phpstan/phpstan": "^0.12.20",
- "phpunit/phpunit": "^7.5 || ^9.1.5"
+ "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35"
},
"type": "library",
"autoload": {
"psr-4": {
- "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ "XdgBaseDir\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "authors": [
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Benjamin Eberlei",
- "email": "kontakt@beberlei.de"
- },
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "description": "implementation of xdg base directory specification for php",
+ "support": {
+ "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues",
+ "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1"
+ },
+ "time": "2019-12-04T15:06:13+00:00"
+ },
+ {
+ "name": "doctrine/deprecations",
+ "version": "1.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/deprecations.git",
+ "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
+ "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/coding-standard": "^9",
+ "phpstan/phpstan": "1.4.10 || 1.10.15",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "psalm/plugin-phpunit": "0.18.4",
+ "psr/log": "^1 || ^2 || ^3",
+ "vimeo/psalm": "4.30.0 || 5.12.0"
+ },
+ "suggest": {
+ "psr/log": "Allows logging deprecations via PSR-3 logger implementation"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
}
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
],
- "description": "Docblock Annotations Parser",
- "homepage": "https://www.doctrine-project.org/projects/annotations.html",
- "keywords": [
- "annotations",
- "docblock",
- "parser"
- ],
+ "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
+ "homepage": "https://www.doctrine-project.org/",
"support": {
- "issues": "https://github.com/doctrine/annotations/issues",
- "source": "https://github.com/doctrine/annotations/tree/1.12.0"
+ "issues": "https://github.com/doctrine/deprecations/issues",
+ "source": "https://github.com/doctrine/deprecations/tree/1.1.2"
},
- "time": "2021-02-14T13:22:18+00:00"
+ "time": "2023-09-27T20:04:15+00:00"
},
{
"name": "doctrine/instantiator",
- "version": "1.4.0",
+ "version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
+ "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
- "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
+ "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
- "doctrine/coding-standard": "^8.0",
+ "doctrine/coding-standard": "^9 || ^11",
"ext-pdo": "*",
"ext-phar": "*",
- "phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
- "phpstan/phpstan": "^0.12",
- "phpstan/phpstan-phpunit": "^0.12",
- "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
+ "phpbench/phpbench": "^0.16 || ^1",
+ "phpstan/phpstan": "^1.4",
+ "phpstan/phpstan-phpunit": "^1",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "vimeo/psalm": "^4.30 || ^5.4"
},
"type": "library",
"autoload": {
@@ -338,7 +595,7 @@
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/1.4.0"
+ "source": "https://github.com/doctrine/instantiator/tree/1.5.0"
},
"funding": [
{
@@ -354,39 +611,48 @@
"type": "tidelift"
}
],
- "time": "2020-11-10T18:47:58+00:00"
+ "time": "2022-12-30T00:15:36+00:00"
},
{
- "name": "doctrine/lexer",
- "version": "1.2.1",
+ "name": "ekino/phpstan-banned-code",
+ "version": "v1.0.0",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/lexer.git",
- "reference": "e864bbf5904cb8f5bb334f99209b48018522f042"
+ "url": "https://github.com/ekino/phpstan-banned-code.git",
+ "reference": "4f0d7c8a0c9f5d222ffc24234aa6c5b3b71bf4c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042",
- "reference": "e864bbf5904cb8f5bb334f99209b48018522f042",
+ "url": "https://api.github.com/repos/ekino/phpstan-banned-code/zipball/4f0d7c8a0c9f5d222ffc24234aa6c5b3b71bf4c3",
+ "reference": "4f0d7c8a0c9f5d222ffc24234aa6c5b3b71bf4c3",
"shasum": ""
},
"require": {
- "php": "^7.2 || ^8.0"
+ "php": "^7.3 || ^8.0",
+ "phpstan/phpstan": "^1.0"
},
"require-dev": {
- "doctrine/coding-standard": "^6.0",
- "phpstan/phpstan": "^0.11.8",
- "phpunit/phpunit": "^8.2"
+ "ergebnis/composer-normalize": "^2.6",
+ "friendsofphp/php-cs-fixer": "^3.0",
+ "nikic/php-parser": "^4.3",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^9.5",
+ "symfony/var-dumper": "^5.0"
},
- "type": "library",
+ "type": "phpstan-extension",
"extra": {
"branch-alias": {
- "dev-master": "1.2.x-dev"
+ "dev-master": "1.0-dev"
+ },
+ "phpstan": {
+ "includes": [
+ "extension.neon"
+ ]
}
},
"autoload": {
"psr-4": {
- "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer"
+ "Ekino\\PHPStanBannedCode\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -395,89 +661,156 @@
],
"authors": [
{
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "name": "Rémi Marseille",
+ "email": "remi.marseille@ekino.com",
+ "homepage": "https://www.ekino.com"
}
],
- "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.",
- "homepage": "https://www.doctrine-project.org/projects/lexer.html",
+ "description": "Detected banned code using PHPStan",
+ "homepage": "https://github.com/ekino/phpstan-banned-code",
"keywords": [
- "annotations",
- "docblock",
- "lexer",
- "parser",
- "php"
+ "PHPStan",
+ "code quality"
],
"support": {
- "issues": "https://github.com/doctrine/lexer/issues",
- "source": "https://github.com/doctrine/lexer/tree/1.2.1"
+ "issues": "https://github.com/ekino/phpstan-banned-code/issues",
+ "source": "https://github.com/ekino/phpstan-banned-code/tree/v1.0.0"
},
- "funding": [
- {
- "url": "https://www.doctrine-project.org/sponsorship.html",
- "type": "custom"
- },
- {
- "url": "https://www.patreon.com/phpdoctrine",
- "type": "patreon"
- },
+ "time": "2021-11-02T08:37:34+00:00"
+ },
+ {
+ "name": "felixfbecker/advanced-json-rpc",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
+ "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447",
+ "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447",
+ "shasum": ""
+ },
+ "require": {
+ "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
+ "php": "^7.1 || ^8.0",
+ "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.0 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "AdvancedJsonRpc\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "ISC"
+ ],
+ "authors": [
{
- "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
- "type": "tidelift"
+ "name": "Felix Becker",
+ "email": "felix.b@outlook.com"
}
],
- "time": "2020-05-25T17:44:05+00:00"
+ "description": "A more advanced JSONRPC implementation",
+ "support": {
+ "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues",
+ "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1"
+ },
+ "time": "2021-06-11T22:34:44+00:00"
},
{
- "name": "ekino/phpstan-banned-code",
- "version": "dev-master",
+ "name": "felixfbecker/language-server-protocol",
+ "version": "v1.5.2",
"source": {
"type": "git",
- "url": "https://github.com/ekino/phpstan-banned-code.git",
- "reference": "dfe4e1e08c29317a046bd0cbfda92cf001f587ed"
+ "url": "https://github.com/felixfbecker/php-language-server-protocol.git",
+ "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ekino/phpstan-banned-code/zipball/dfe4e1e08c29317a046bd0cbfda92cf001f587ed",
- "reference": "dfe4e1e08c29317a046bd0cbfda92cf001f587ed",
+ "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842",
+ "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842",
"shasum": ""
},
"require": {
- "php": "^7.2 || ^8.0",
- "phpstan/phpstan": "^0.12"
+ "php": ">=7.1"
},
"require-dev": {
- "ergebnis/composer-normalize": "^2.6",
- "friendsofphp/php-cs-fixer": "^2.17",
- "nikic/php-parser": "^4.3",
- "phpstan/phpstan-phpunit": "^0.12",
- "phpunit/phpunit": "^8.5",
- "sensiolabs/security-checker": "^6.0",
- "symfony/var-dumper": "^5.0"
+ "phpstan/phpstan": "*",
+ "squizlabs/php_codesniffer": "^3.1",
+ "vimeo/psalm": "^4.0"
},
- "default-branch": true,
- "type": "phpstan-extension",
+ "type": "library",
"extra": {
"branch-alias": {
- "dev-master": "0.10-dev"
- },
- "phpstan": {
- "includes": [
- "extension.neon"
- ]
+ "dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
- "Ekino\\PHPStanBannedCode\\": "src"
+ "LanguageServerProtocol\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "ISC"
+ ],
+ "authors": [
+ {
+ "name": "Felix Becker",
+ "email": "felix.b@outlook.com"
+ }
+ ],
+ "description": "PHP classes for the Language Server Protocol",
+ "keywords": [
+ "language",
+ "microsoft",
+ "php",
+ "server"
+ ],
+ "support": {
+ "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues",
+ "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2"
+ },
+ "time": "2022-03-02T22:36:06+00:00"
+ },
+ {
+ "name": "fidry/cpu-core-counter",
+ "version": "0.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theofidry/cpu-core-counter.git",
+ "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623",
+ "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "fidry/makefile": "^0.2.0",
+ "phpstan/extension-installer": "^1.2.0",
+ "phpstan/phpstan": "^1.9.2",
+ "phpstan/phpstan-deprecation-rules": "^1.0.0",
+ "phpstan/phpstan-phpunit": "^1.2.2",
+ "phpstan/phpstan-strict-rules": "^1.4.4",
+ "phpunit/phpunit": "^9.5.26 || ^8.5.31",
+ "theofidry/php-cs-fixer-config": "^1.0",
+ "webmozarts/strict-phpunit": "^7.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Fidry\\CpuCoreCounter\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -486,77 +819,77 @@
],
"authors": [
{
- "name": "Rémi Marseille",
- "email": "remi.marseille@ekino.com",
- "homepage": "https://www.ekino.com"
+ "name": "Théo FIDRY",
+ "email": "theo.fidry@gmail.com"
}
],
- "description": "Detected banned code using PHPStan",
- "homepage": "https://github.com/ekino/phpstan-banned-code",
+ "description": "Tiny utility to get the number of CPU cores.",
"keywords": [
- "PHPStan",
- "code quality"
+ "CPU",
+ "core"
],
"support": {
- "issues": "https://github.com/ekino/phpstan-banned-code/issues",
- "source": "https://github.com/ekino/phpstan-banned-code/tree/master"
+ "issues": "https://github.com/theofidry/cpu-core-counter/issues",
+ "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1"
},
- "time": "2021-01-15T12:39:33+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/theofidry",
+ "type": "github"
+ }
+ ],
+ "time": "2022-12-24T12:35:10+00:00"
},
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v2.18.2",
+ "version": "v3.35.1",
"source": {
"type": "git",
- "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
- "reference": "18f8c9d184ba777380794a389fabc179896ba913"
+ "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
+ "reference": "ec1ccc264994b6764882669973ca435cf05bab08"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/18f8c9d184ba777380794a389fabc179896ba913",
- "reference": "18f8c9d184ba777380794a389fabc179896ba913",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ec1ccc264994b6764882669973ca435cf05bab08",
+ "reference": "ec1ccc264994b6764882669973ca435cf05bab08",
"shasum": ""
},
"require": {
- "composer/semver": "^1.4 || ^2.0 || ^3.0",
- "composer/xdebug-handler": "^1.2",
- "doctrine/annotations": "^1.2",
+ "composer/semver": "^3.3",
+ "composer/xdebug-handler": "^3.0.3",
"ext-json": "*",
"ext-tokenizer": "*",
- "php": "^5.6 || ^7.0 || ^8.0",
- "php-cs-fixer/diff": "^1.3",
- "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0",
- "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0",
- "symfony/filesystem": "^3.0 || ^4.0 || ^5.0",
- "symfony/finder": "^3.0 || ^4.0 || ^5.0",
- "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0",
- "symfony/polyfill-php70": "^1.0",
- "symfony/polyfill-php72": "^1.4",
- "symfony/process": "^3.0 || ^4.0 || ^5.0",
- "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0"
+ "php": "^7.4 || ^8.0",
+ "sebastian/diff": "^4.0 || ^5.0",
+ "symfony/console": "^5.4 || ^6.0",
+ "symfony/event-dispatcher": "^5.4 || ^6.0",
+ "symfony/filesystem": "^5.4 || ^6.0",
+ "symfony/finder": "^5.4 || ^6.0",
+ "symfony/options-resolver": "^5.4 || ^6.0",
+ "symfony/polyfill-mbstring": "^1.27",
+ "symfony/polyfill-php80": "^1.27",
+ "symfony/polyfill-php81": "^1.27",
+ "symfony/process": "^5.4 || ^6.0",
+ "symfony/stopwatch": "^5.4 || ^6.0"
},
"require-dev": {
- "justinrainbow/json-schema": "^5.0",
- "keradus/cli-executor": "^1.4",
- "mikey179/vfsstream": "^1.6",
- "php-coveralls/php-coveralls": "^2.4.2",
- "php-cs-fixer/accessible-object": "^1.0",
+ "facile-it/paraunit": "^1.3 || ^2.0",
+ "justinrainbow/json-schema": "^5.2",
+ "keradus/cli-executor": "^2.0",
+ "mikey179/vfsstream": "^1.6.11",
+ "php-coveralls/php-coveralls": "^2.5.3",
+ "php-cs-fixer/accessible-object": "^1.1",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
- "phpspec/prophecy-phpunit": "^1.1 || ^2.0",
- "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5",
- "phpunitgoodpractices/polyfill": "^1.5",
- "phpunitgoodpractices/traits": "^1.9.1",
- "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1",
- "symfony/phpunit-bridge": "^5.2.1",
- "symfony/yaml": "^3.0 || ^4.0 || ^5.0"
+ "phpspec/prophecy": "^1.16",
+ "phpspec/prophecy-phpunit": "^2.0",
+ "phpunit/phpunit": "^9.5",
+ "symfony/phpunit-bridge": "^6.2.3",
+ "symfony/yaml": "^5.4 || ^6.0"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
- "ext-mbstring": "For handling non-UTF8 characters.",
- "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.",
- "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.",
- "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible."
+ "ext-mbstring": "For handling non-UTF8 characters."
},
"bin": [
"php-cs-fixer"
@@ -565,19 +898,7 @@
"autoload": {
"psr-4": {
"PhpCsFixer\\": "src/"
- },
- "classmap": [
- "tests/Test/AbstractFixerTestCase.php",
- "tests/Test/AbstractIntegrationCaseFactory.php",
- "tests/Test/AbstractIntegrationTestCase.php",
- "tests/Test/Assert/AssertTokensTrait.php",
- "tests/Test/IntegrationCase.php",
- "tests/Test/IntegrationCaseFactory.php",
- "tests/Test/IntegrationCaseFactoryInterface.php",
- "tests/Test/InternalIntegrationCaseFactory.php",
- "tests/Test/IsIdenticalConstraint.php",
- "tests/TestCase.php"
- ]
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -594,9 +915,15 @@
}
],
"description": "A tool to automatically fix PHP code style",
+ "keywords": [
+ "Static code analysis",
+ "fixer",
+ "standards",
+ "static analysis"
+ ],
"support": {
- "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues",
- "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.2"
+ "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.35.1"
},
"funding": [
{
@@ -604,41 +931,42 @@
"type": "github"
}
],
- "time": "2021-01-26T00:22:21+00:00"
+ "time": "2023-10-12T13:47:26+00:00"
},
{
"name": "myclabs/deep-copy",
- "version": "1.10.2",
+ "version": "1.11.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220"
+ "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220",
- "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
+ "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
- "replace": {
- "myclabs/deep-copy": "self.version"
+ "conflict": {
+ "doctrine/collections": "<1.6.8",
+ "doctrine/common": "<2.13.3 || >=3,<3.2.2"
},
"require-dev": {
- "doctrine/collections": "^1.0",
- "doctrine/common": "^2.6",
- "phpunit/phpunit": "^7.1"
+ "doctrine/collections": "^1.6.8",
+ "doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"type": "library",
"autoload": {
- "psr-4": {
- "DeepCopy\\": "src/DeepCopy/"
- },
"files": [
"src/DeepCopy/deep_copy.php"
- ]
+ ],
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -654,7 +982,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
- "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2"
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
},
"funding": [
{
@@ -662,20 +990,71 @@
"type": "tidelift"
}
],
- "time": "2020-11-13T09:40:50+00:00"
+ "time": "2023-03-08T13:26:56+00:00"
+ },
+ {
+ "name": "netresearch/jsonmapper",
+ "version": "v4.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/cweiske/jsonmapper.git",
+ "reference": "f60565f8c0566a31acf06884cdaa591867ecc956"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956",
+ "reference": "f60565f8c0566a31acf06884cdaa591867ecc956",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-spl": "*",
+ "php": ">=7.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0",
+ "squizlabs/php_codesniffer": "~3.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "JsonMapper": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "OSL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Christian Weiske",
+ "email": "cweiske@cweiske.de",
+ "homepage": "http://github.com/cweiske/jsonmapper/",
+ "role": "Developer"
+ }
+ ],
+ "description": "Map nested JSON structures onto PHP classes",
+ "support": {
+ "email": "cweiske@cweiske.de",
+ "issues": "https://github.com/cweiske/jsonmapper/issues",
+ "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0"
+ },
+ "time": "2023-04-09T17:37:40+00:00"
},
{
"name": "nikic/php-parser",
- "version": "v4.10.4",
+ "version": "v4.17.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e"
+ "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e",
- "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
+ "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
"shasum": ""
},
"require": {
@@ -716,22 +1095,22 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1"
},
- "time": "2020-12-20T10:01:03+00:00"
+ "time": "2023-08-13T19:53:39+00:00"
},
{
"name": "phar-io/manifest",
- "version": "2.0.1",
+ "version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/phar-io/manifest.git",
- "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133"
+ "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
- "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
+ "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
"shasum": ""
},
"require": {
@@ -776,22 +1155,22 @@
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
"support": {
"issues": "https://github.com/phar-io/manifest/issues",
- "source": "https://github.com/phar-io/manifest/tree/master"
+ "source": "https://github.com/phar-io/manifest/tree/2.0.3"
},
- "time": "2020-06-27T14:33:11+00:00"
+ "time": "2021-07-20T11:28:43+00:00"
},
{
"name": "phar-io/version",
- "version": "3.0.4",
+ "version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
- "reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
- "reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"shasum": ""
},
"require": {
@@ -827,64 +1206,9 @@
"description": "Library for handling version information and constraints",
"support": {
"issues": "https://github.com/phar-io/version/issues",
- "source": "https://github.com/phar-io/version/tree/3.0.4"
+ "source": "https://github.com/phar-io/version/tree/3.2.1"
},
- "time": "2020-12-13T23:18:30+00:00"
- },
- {
- "name": "php-cs-fixer/diff",
- "version": "v1.3.1",
- "source": {
- "type": "git",
- "url": "https://github.com/PHP-CS-Fixer/diff.git",
- "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759",
- "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759",
- "shasum": ""
- },
- "require": {
- "php": "^5.6 || ^7.0 || ^8.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0",
- "symfony/process": "^3.3"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
- },
- {
- "name": "SpacePossum"
- }
- ],
- "description": "sebastian/diff v2 backport support for PHP5.6",
- "homepage": "https://github.com/PHP-CS-Fixer",
- "keywords": [
- "diff"
- ],
- "support": {
- "issues": "https://github.com/PHP-CS-Fixer/diff/issues",
- "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1"
- },
- "time": "2020-10-14T08:39:05+00:00"
+ "time": "2022-02-21T01:04:05+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@@ -941,16 +1265,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.2.2",
+ "version": "5.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
- "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
"shasum": ""
},
"require": {
@@ -961,7 +1285,8 @@
"webmozart/assert": "^1.9.1"
},
"require-dev": {
- "mockery/mockery": "~1.3.2"
+ "mockery/mockery": "~1.3.2",
+ "psalm/phar": "^4.8"
},
"type": "library",
"extra": {
@@ -991,30 +1316,39 @@
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
},
- "time": "2020-09-03T19:13:55+00:00"
+ "time": "2021-10-19T17:43:47+00:00"
},
{
"name": "phpdocumentor/type-resolver",
- "version": "1.4.0",
+ "version": "1.7.3",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
+ "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
- "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419",
+ "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419",
"shasum": ""
},
"require": {
- "php": "^7.2 || ^8.0",
- "phpdocumentor/reflection-common": "^2.0"
+ "doctrine/deprecations": "^1.0",
+ "php": "^7.4 || ^8.0",
+ "phpdocumentor/reflection-common": "^2.0",
+ "phpstan/phpdoc-parser": "^1.13"
},
"require-dev": {
- "ext-tokenizer": "*"
+ "ext-tokenizer": "*",
+ "phpbench/phpbench": "^1.2",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan": "^1.8",
+ "phpstan/phpstan-phpunit": "^1.1",
+ "phpunit/phpunit": "^9.5",
+ "rector/rector": "^0.13.9",
+ "vimeo/psalm": "^4.25"
},
"type": "library",
"extra": {
@@ -1040,138 +1374,117 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
- "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3"
},
- "time": "2020-09-17T18:55:26+00:00"
+ "time": "2023-08-12T11:01:26+00:00"
},
{
- "name": "phpspec/prophecy",
- "version": "1.12.2",
+ "name": "phpstan/extension-installer",
+ "version": "1.3.1",
"source": {
"type": "git",
- "url": "https://github.com/phpspec/prophecy.git",
- "reference": "245710e971a030f42e08f4912863805570f23d39"
+ "url": "https://github.com/phpstan/extension-installer.git",
+ "reference": "f45734bfb9984c6c56c4486b71230355f066a58a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39",
- "reference": "245710e971a030f42e08f4912863805570f23d39",
+ "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a",
+ "reference": "f45734bfb9984c6c56c4486b71230355f066a58a",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.2",
- "php": "^7.2 || ~8.0, <8.1",
- "phpdocumentor/reflection-docblock": "^5.2",
- "sebastian/comparator": "^3.0 || ^4.0",
- "sebastian/recursion-context": "^3.0 || ^4.0"
+ "composer-plugin-api": "^2.0",
+ "php": "^7.2 || ^8.0",
+ "phpstan/phpstan": "^1.9.0"
},
"require-dev": {
- "phpspec/phpspec": "^6.0",
- "phpunit/phpunit": "^8.0 || ^9.0"
+ "composer/composer": "^2.0",
+ "php-parallel-lint/php-parallel-lint": "^1.2.0",
+ "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0"
},
- "type": "library",
+ "type": "composer-plugin",
"extra": {
- "branch-alias": {
- "dev-master": "1.11.x-dev"
- }
+ "class": "PHPStan\\ExtensionInstaller\\Plugin"
},
"autoload": {
"psr-4": {
- "Prophecy\\": "src/Prophecy"
+ "PHPStan\\ExtensionInstaller\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "authors": [
- {
- "name": "Konstantin Kudryashov",
- "email": "ever.zet@gmail.com",
- "homepage": "http://everzet.com"
- },
- {
- "name": "Marcello Duarte",
- "email": "marcello.duarte@gmail.com"
- }
- ],
- "description": "Highly opinionated mocking framework for PHP 5.3+",
- "homepage": "https://github.com/phpspec/prophecy",
- "keywords": [
- "Double",
- "Dummy",
- "fake",
- "mock",
- "spy",
- "stub"
- ],
+ "description": "Composer plugin for automatic installation of PHPStan extensions",
"support": {
- "issues": "https://github.com/phpspec/prophecy/issues",
- "source": "https://github.com/phpspec/prophecy/tree/1.12.2"
+ "issues": "https://github.com/phpstan/extension-installer/issues",
+ "source": "https://github.com/phpstan/extension-installer/tree/1.3.1"
},
- "time": "2020-12-19T10:15:11+00:00"
+ "time": "2023-05-24T08:59:17+00:00"
},
{
- "name": "phpstan/extension-installer",
- "version": "1.1.0",
+ "name": "phpstan/phpdoc-parser",
+ "version": "1.24.2",
"source": {
"type": "git",
- "url": "https://github.com/phpstan/extension-installer.git",
- "reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051"
+ "url": "https://github.com/phpstan/phpdoc-parser.git",
+ "reference": "bcad8d995980440892759db0c32acae7c8e79442"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/66c7adc9dfa38b6b5838a9fb728b68a7d8348051",
- "reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442",
+ "reference": "bcad8d995980440892759db0c32acae7c8e79442",
"shasum": ""
},
"require": {
- "composer-plugin-api": "^1.1 || ^2.0",
- "php": "^7.1 || ^8.0",
- "phpstan/phpstan": ">=0.11.6"
+ "php": "^7.2 || ^8.0"
},
"require-dev": {
- "composer/composer": "^1.8",
- "phing/phing": "^2.16.3",
- "php-parallel-lint/php-parallel-lint": "^1.2.0",
- "phpstan/phpstan-strict-rules": "^0.11 || ^0.12"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "PHPStan\\ExtensionInstaller\\Plugin"
+ "doctrine/annotations": "^2.0",
+ "nikic/php-parser": "^4.15",
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^1.5",
+ "phpstan/phpstan-phpunit": "^1.1",
+ "phpstan/phpstan-strict-rules": "^1.0",
+ "phpunit/phpunit": "^9.5",
+ "symfony/process": "^5.2"
},
+ "type": "library",
"autoload": {
"psr-4": {
- "PHPStan\\ExtensionInstaller\\": "src/"
+ "PHPStan\\PhpDocParser\\": [
+ "src/"
+ ]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "description": "Composer plugin for automatic installation of PHPStan extensions",
+ "description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
- "issues": "https://github.com/phpstan/extension-installer/issues",
- "source": "https://github.com/phpstan/extension-installer/tree/1.1.0"
+ "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2"
},
- "time": "2020-12-13T13:06:13+00:00"
+ "time": "2023-09-26T12:28:12+00:00"
},
{
"name": "phpstan/phpstan",
- "version": "0.12.78",
+ "version": "1.10.38",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "eecce8d2ee3cac6769f37b4cb1998b2715f82984"
+ "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/eecce8d2ee3cac6769f37b4cb1998b2715f82984",
- "reference": "eecce8d2ee3cac6769f37b4cb1998b2715f82984",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5302bb402c57f00fb3c2c015bac86e0827e4b691",
+ "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691",
"shasum": ""
},
"require": {
- "php": "^7.1|^8.0"
+ "php": "^7.2|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
@@ -1181,11 +1494,6 @@
"phpstan.phar"
],
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.12-dev"
- }
- },
"autoload": {
"files": [
"bootstrap.php"
@@ -1196,9 +1504,16 @@
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
+ "keywords": [
+ "dev",
+ "static analysis"
+ ],
"support": {
+ "docs": "https://phpstan.org/user-guide/getting-started",
+ "forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
- "source": "https://github.com/phpstan/phpstan/tree/0.12.78"
+ "security": "https://github.com/phpstan/phpstan/security/policy",
+ "source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
@@ -1206,47 +1521,44 @@
"type": "github"
},
{
- "url": "https://www.patreon.com/phpstan",
- "type": "patreon"
+ "url": "https://github.com/phpstan",
+ "type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
- "time": "2021-02-20T13:24:36+00:00"
+ "time": "2023-10-06T14:19:14+00:00"
},
{
"name": "phpstan/phpstan-beberlei-assert",
- "version": "0.12.6",
+ "version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-beberlei-assert.git",
- "reference": "daf1176ee507b7dcd01276fabf20a0a308c94124"
+ "reference": "0918f2c71f93d44839b74fe3ba2682b2083a8729"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-beberlei-assert/zipball/daf1176ee507b7dcd01276fabf20a0a308c94124",
- "reference": "daf1176ee507b7dcd01276fabf20a0a308c94124",
+ "url": "https://api.github.com/repos/phpstan/phpstan-beberlei-assert/zipball/0918f2c71f93d44839b74fe3ba2682b2083a8729",
+ "reference": "0918f2c71f93d44839b74fe3ba2682b2083a8729",
"shasum": ""
},
"require": {
- "php": "^7.1 || ^8.0",
- "phpstan/phpstan": "^0.12.40"
+ "php": "^7.2 || ^8.0",
+ "phpstan/phpstan": "^1.10"
},
"require-dev": {
"beberlei/assert": "^3.3.0",
- "phing/phing": "^2.16.3",
+ "nikic/php-parser": "^4.13.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
- "phpstan/phpstan-phpunit": "^0.12.16",
- "phpstan/phpstan-strict-rules": "^0.12.5",
- "phpunit/phpunit": "^7.5.20"
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.0",
+ "phpunit/phpunit": "^9.5"
},
"type": "phpstan-extension",
"extra": {
- "branch-alias": {
- "dev-master": "0.12-dev"
- },
"phpstan": {
"includes": [
"extension.neon"
@@ -1265,42 +1577,39 @@
"description": "PHPStan beberlei/assert extension",
"support": {
"issues": "https://github.com/phpstan/phpstan-beberlei-assert/issues",
- "source": "https://github.com/phpstan/phpstan-beberlei-assert/tree/0.12.6"
+ "source": "https://github.com/phpstan/phpstan-beberlei-assert/tree/1.1.2"
},
- "time": "2021-01-25T12:31:38+00:00"
+ "time": "2023-09-04T12:13:01+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
- "version": "0.12.17",
+ "version": "1.3.15",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git",
- "reference": "432575b41cf2d4f44e460234acaf56119ed97d36"
+ "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/432575b41cf2d4f44e460234acaf56119ed97d36",
- "reference": "432575b41cf2d4f44e460234acaf56119ed97d36",
+ "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/70ecacc64fe8090d8d2a33db5a51fe8e88acd93a",
+ "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a",
"shasum": ""
},
"require": {
- "php": "^7.1 || ^8.0",
- "phpstan/phpstan": "^0.12.60"
+ "php": "^7.2 || ^8.0",
+ "phpstan/phpstan": "^1.10"
},
"conflict": {
"phpunit/phpunit": "<7.0"
},
"require-dev": {
- "phing/phing": "^2.16.3",
+ "nikic/php-parser": "^4.13.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
- "phpstan/phpstan-strict-rules": "^0.12.6",
- "phpunit/phpunit": "^7.5.20"
+ "phpstan/phpstan-strict-rules": "^1.5.1",
+ "phpunit/phpunit": "^9.5"
},
"type": "phpstan-extension",
"extra": {
- "branch-alias": {
- "dev-master": "0.12-dev"
- },
"phpstan": {
"includes": [
"extension.neon",
@@ -1320,29 +1629,29 @@
"description": "PHPUnit extensions and rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
- "source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.17"
+ "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.15"
},
- "time": "2020-12-13T12:12:51+00:00"
+ "time": "2023-10-09T18:58:39+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.2.5",
+ "version": "9.2.29",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1"
+ "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1",
- "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76",
+ "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
- "nikic/php-parser": "^4.10.2",
+ "nikic/php-parser": "^4.15",
"php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
@@ -1357,8 +1666,8 @@
"phpunit/phpunit": "^9.3"
},
"suggest": {
- "ext-pcov": "*",
- "ext-xdebug": "*"
+ "ext-pcov": "PHP extension that provides line coverage",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
},
"type": "library",
"extra": {
@@ -1391,7 +1700,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5"
+ "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29"
},
"funding": [
{
@@ -1399,20 +1709,20 @@
"type": "github"
}
],
- "time": "2020-11-28T06:44:49+00:00"
+ "time": "2023-09-19T04:57:46+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "3.0.5",
+ "version": "3.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"shasum": ""
},
"require": {
@@ -1451,7 +1761,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
- "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
},
"funding": [
{
@@ -1459,7 +1769,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:57:25+00:00"
+ "time": "2021-12-02T12:48:52+00:00"
},
{
"name": "phpunit/php-invoker",
@@ -1644,20 +1954,20 @@
},
{
"name": "phpunit/phpunit",
- "version": "9.5.2",
+ "version": "9.6.13",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4"
+ "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4",
- "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be",
+ "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.3.1",
+ "doctrine/instantiator": "^1.3.1 || ^2",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
@@ -1665,34 +1975,29 @@
"ext-xml": "*",
"ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.10.1",
- "phar-io/manifest": "^2.0.1",
+ "phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"php": ">=7.3",
- "phpspec/prophecy": "^1.12.1",
- "phpunit/php-code-coverage": "^9.2.3",
+ "phpunit/php-code-coverage": "^9.2.28",
"phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.3",
"phpunit/php-timer": "^5.0.2",
"sebastian/cli-parser": "^1.0.1",
"sebastian/code-unit": "^1.0.6",
- "sebastian/comparator": "^4.0.5",
+ "sebastian/comparator": "^4.0.8",
"sebastian/diff": "^4.0.3",
"sebastian/environment": "^5.1.3",
- "sebastian/exporter": "^4.0.3",
+ "sebastian/exporter": "^4.0.5",
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
- "sebastian/type": "^2.3",
+ "sebastian/type": "^3.2",
"sebastian/version": "^3.0.2"
},
- "require-dev": {
- "ext-pdo": "*",
- "phpspec/prophecy-phpunit": "^2.0.1"
- },
"suggest": {
- "ext-soap": "*",
- "ext-xdebug": "*"
+ "ext-soap": "To be able to generate mocks based on WSDL files",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
},
"bin": [
"phpunit"
@@ -1700,15 +2005,15 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.5-dev"
+ "dev-master": "9.6-dev"
}
},
"autoload": {
- "classmap": [
- "src/"
- ],
"files": [
"src/Framework/Assert/Functions.php"
+ ],
+ "classmap": [
+ "src/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -1731,43 +2036,43 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2"
+ "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13"
},
"funding": [
{
- "url": "https://phpunit.de/donate.html",
+ "url": "https://phpunit.de/sponsors.html",
"type": "custom"
},
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
+ "type": "tidelift"
}
],
- "time": "2021-02-02T14:45:58+00:00"
+ "time": "2023-09-19T05:39:22+00:00"
},
{
"name": "psr/container",
- "version": "1.0.0",
+ "version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=7.4.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
@@ -1780,7 +2085,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
@@ -1794,9 +2099,9 @@
],
"support": {
"issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/master"
+ "source": "https://github.com/php-fig/container/tree/1.1.2"
},
- "time": "2017-02-14T16:28:37+00:00"
+ "time": "2021-11-05T16:50:12+00:00"
},
{
"name": "psr/event-dispatcher",
@@ -1850,30 +2155,30 @@
},
{
"name": "psr/log",
- "version": "1.1.3",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
+ "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
- "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376",
+ "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1883,7 +2188,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
@@ -1894,9 +2199,9 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.3"
+ "source": "https://github.com/php-fig/log/tree/2.0.0"
},
- "time": "2020-03-23T09:12:05+00:00"
+ "time": "2021-07-14T16:41:46+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -2067,16 +2372,16 @@
},
{
"name": "sebastian/comparator",
- "version": "4.0.6",
+ "version": "4.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382"
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a",
"shasum": ""
},
"require": {
@@ -2129,7 +2434,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
- "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6"
+ "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8"
},
"funding": [
{
@@ -2137,7 +2442,7 @@
"type": "github"
}
],
- "time": "2020-10-26T15:49:45+00:00"
+ "time": "2022-09-14T12:41:17+00:00"
},
{
"name": "sebastian/complexity",
@@ -2198,16 +2503,16 @@
},
{
"name": "sebastian/diff",
- "version": "4.0.4",
+ "version": "4.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
+ "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
+ "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
"shasum": ""
},
"require": {
@@ -2252,7 +2557,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
- "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5"
},
"funding": [
{
@@ -2260,20 +2565,20 @@
"type": "github"
}
],
- "time": "2020-10-26T13:10:38+00:00"
+ "time": "2023-05-07T05:35:17+00:00"
},
{
"name": "sebastian/environment",
- "version": "5.1.3",
+ "version": "5.1.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac"
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
"shasum": ""
},
"require": {
@@ -2315,7 +2620,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
- "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3"
+ "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
},
"funding": [
{
@@ -2323,20 +2628,20 @@
"type": "github"
}
],
- "time": "2020-09-28T05:52:38+00:00"
+ "time": "2023-02-03T06:03:51+00:00"
},
{
"name": "sebastian/exporter",
- "version": "4.0.3",
+ "version": "4.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
+ "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
+ "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
"shasum": ""
},
"require": {
@@ -2385,14 +2690,14 @@
}
],
"description": "Provides the functionality to export PHP variables for visualization",
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
- "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
+ "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5"
},
"funding": [
{
@@ -2400,20 +2705,20 @@
"type": "github"
}
],
- "time": "2020-09-28T05:24:23+00:00"
+ "time": "2022-09-14T06:03:37+00:00"
},
{
"name": "sebastian/global-state",
- "version": "5.0.2",
+ "version": "5.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "a90ccbddffa067b51f574dea6eb25d5680839455"
+ "reference": "bde739e7565280bda77be70044ac1047bc007e34"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455",
- "reference": "a90ccbddffa067b51f574dea6eb25d5680839455",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34",
+ "reference": "bde739e7565280bda77be70044ac1047bc007e34",
"shasum": ""
},
"require": {
@@ -2456,7 +2761,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
- "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2"
+ "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6"
},
"funding": [
{
@@ -2464,7 +2769,7 @@
"type": "github"
}
],
- "time": "2020-10-26T15:55:19+00:00"
+ "time": "2023-08-02T09:26:13+00:00"
},
{
"name": "sebastian/lines-of-code",
@@ -2637,16 +2942,16 @@
},
{
"name": "sebastian/recursion-context",
- "version": "4.0.4",
+ "version": "4.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172"
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
"shasum": ""
},
"require": {
@@ -2685,10 +2990,10 @@
}
],
"description": "Provides functionality to recursively process PHP variables",
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
- "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4"
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5"
},
"funding": [
{
@@ -2696,7 +3001,7 @@
"type": "github"
}
],
- "time": "2020-10-26T13:17:30+00:00"
+ "time": "2023-02-03T06:07:39+00:00"
},
{
"name": "sebastian/resource-operations",
@@ -2755,28 +3060,28 @@
},
{
"name": "sebastian/type",
- "version": "2.3.1",
+ "version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2"
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
- "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
"shasum": ""
},
"require": {
"php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^9.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2799,7 +3104,7 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
- "source": "https://github.com/sebastianbergmann/type/tree/2.3.1"
+ "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
},
"funding": [
{
@@ -2807,7 +3112,7 @@
"type": "github"
}
],
- "time": "2020-10-26T13:18:59+00:00"
+ "time": "2023-02-03T06:13:03+00:00"
},
{
"name": "sebastian/version",
@@ -2862,29 +3167,94 @@
],
"time": "2020-09-28T06:39:44+00:00"
},
+ {
+ "name": "spatie/array-to-xml",
+ "version": "3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/array-to-xml.git",
+ "reference": "f9ab39c808500c347d5a8b6b13310bd5221e39e7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/f9ab39c808500c347d5a8b6b13310bd5221e39e7",
+ "reference": "f9ab39c808500c347d5a8b6b13310bd5221e39e7",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "php": "^8.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^1.2",
+ "pestphp/pest": "^1.21",
+ "spatie/pest-plugin-snapshots": "^1.1"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Spatie\\ArrayToXml\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Freek Van der Herten",
+ "email": "freek@spatie.be",
+ "homepage": "https://freek.dev",
+ "role": "Developer"
+ }
+ ],
+ "description": "Convert an array to xml",
+ "homepage": "https://github.com/spatie/array-to-xml",
+ "keywords": [
+ "array",
+ "convert",
+ "xml"
+ ],
+ "support": {
+ "source": "https://github.com/spatie/array-to-xml/tree/3.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://spatie.be/open-source/support-us",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/spatie",
+ "type": "github"
+ }
+ ],
+ "time": "2023-07-19T18:30:26+00:00"
+ },
{
"name": "symfony/console",
- "version": "v5.2.3",
+ "version": "v5.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a"
+ "reference": "f4f71842f24c2023b91237c72a365306f3c58827"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/89d4b176d12a2946a1ae4e34906a025b7b6b135a",
- "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a",
+ "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827",
+ "reference": "f4f71842f24c2023b91237c72a365306f3c58827",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php73": "^1.8",
- "symfony/polyfill-php80": "^1.15",
- "symfony/service-contracts": "^1.1|^2",
- "symfony/string": "^5.1"
+ "symfony/polyfill-php73": "^1.9",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/string": "^5.1|^6.0"
},
"conflict": {
+ "psr/log": ">=3",
"symfony/dependency-injection": "<4.4",
"symfony/dotenv": "<5.1",
"symfony/event-dispatcher": "<4.4",
@@ -2892,16 +3262,16 @@
"symfony/process": "<4.4"
},
"provide": {
- "psr/log-implementation": "1.0"
+ "psr/log-implementation": "1.0|2.0"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "^4.4|^5.0",
- "symfony/dependency-injection": "^4.4|^5.0",
- "symfony/event-dispatcher": "^4.4|^5.0",
- "symfony/lock": "^4.4|^5.0",
- "symfony/process": "^4.4|^5.0",
- "symfony/var-dumper": "^4.4|^5.0"
+ "psr/log": "^1|^2",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+ "symfony/lock": "^4.4|^5.0|^6.0",
+ "symfony/process": "^4.4|^5.0|^6.0",
+ "symfony/var-dumper": "^4.4|^5.0|^6.0"
},
"suggest": {
"psr/log": "For using the console logger",
@@ -2936,12 +3306,12 @@
"homepage": "https://symfony.com",
"keywords": [
"cli",
- "command line",
+ "command-line",
"console",
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.2.3"
+ "source": "https://github.com/symfony/console/tree/v5.4.28"
},
"funding": [
{
@@ -2957,20 +3327,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-28T22:06:19+00:00"
+ "time": "2023-08-07T06:12:30+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v2.2.0",
+ "version": "v2.5.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
- "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
"shasum": ""
},
"require": {
@@ -2979,7 +3349,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -3008,7 +3378,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/master"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
},
"funding": [
{
@@ -3024,27 +3394,27 @@
"type": "tidelift"
}
],
- "time": "2020-09-07T11:33:47+00:00"
+ "time": "2022-01-02T09:53:40+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v5.2.3",
+ "version": "v5.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367"
+ "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4f9760f8074978ad82e2ce854dff79a71fe45367",
- "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5dcc00e03413f05c1e7900090927bb7247cb0aac",
+ "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
- "symfony/event-dispatcher-contracts": "^2",
- "symfony/polyfill-php80": "^1.15"
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/event-dispatcher-contracts": "^2|^3",
+ "symfony/polyfill-php80": "^1.16"
},
"conflict": {
"symfony/dependency-injection": "<4.4"
@@ -3054,14 +3424,14 @@
"symfony/event-dispatcher-implementation": "2.0"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "^4.4|^5.0",
- "symfony/dependency-injection": "^4.4|^5.0",
- "symfony/error-handler": "^4.4|^5.0",
- "symfony/expression-language": "^4.4|^5.0",
- "symfony/http-foundation": "^4.4|^5.0",
- "symfony/service-contracts": "^1.1|^2",
- "symfony/stopwatch": "^4.4|^5.0"
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/expression-language": "^4.4|^5.0|^6.0",
+ "symfony/http-foundation": "^4.4|^5.0|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/stopwatch": "^4.4|^5.0|^6.0"
},
"suggest": {
"symfony/dependency-injection": "",
@@ -3093,7 +3463,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.3"
+ "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.26"
},
"funding": [
{
@@ -3109,20 +3479,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-27T10:36:42+00:00"
+ "time": "2023-07-06T06:34:20+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
- "version": "v2.2.0",
+ "version": "v2.5.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
- "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2"
+ "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2",
- "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1",
+ "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1",
"shasum": ""
},
"require": {
@@ -3135,7 +3505,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -3172,7 +3542,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.2.0"
+ "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2"
},
"funding": [
{
@@ -3188,25 +3558,27 @@
"type": "tidelift"
}
],
- "time": "2020-09-07T11:33:47+00:00"
+ "time": "2022-01-02T09:53:40+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v5.2.3",
+ "version": "v5.4.25",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "262d033b57c73e8b59cd6e68a45c528318b15038"
+ "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/262d033b57c73e8b59cd6e68a45c528318b15038",
- "reference": "262d033b57c73e8b59cd6e68a45c528318b15038",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364",
+ "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/polyfill-ctype": "~1.8"
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.8",
+ "symfony/polyfill-php80": "^1.16"
},
"type": "library",
"autoload": {
@@ -3234,7 +3606,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/filesystem/tree/v5.2.3"
+ "source": "https://github.com/symfony/filesystem/tree/v5.4.25"
},
"funding": [
{
@@ -3250,24 +3622,26 @@
"type": "tidelift"
}
],
- "time": "2021-01-27T10:01:46+00:00"
+ "time": "2023-05-31T13:04:02+00:00"
},
{
"name": "symfony/finder",
- "version": "v5.2.3",
+ "version": "v5.4.27",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "4adc8d172d602008c204c2e16956f99257248e03"
+ "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/4adc8d172d602008c204c2e16956f99257248e03",
- "reference": "4adc8d172d602008c204c2e16956f99257248e03",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d",
+ "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d",
"shasum": ""
},
"require": {
- "php": ">=7.2.5"
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-php80": "^1.16"
},
"type": "library",
"autoload": {
@@ -3295,7 +3669,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v5.2.3"
+ "source": "https://github.com/symfony/finder/tree/v5.4.27"
},
"funding": [
{
@@ -3311,27 +3685,27 @@
"type": "tidelift"
}
],
- "time": "2021-01-28T22:06:19+00:00"
+ "time": "2023-07-31T08:02:31+00:00"
},
{
"name": "symfony/options-resolver",
- "version": "v5.2.3",
+ "version": "v5.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
- "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce"
+ "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce",
- "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9",
+ "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
+ "symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-php73": "~1.0",
- "symfony/polyfill-php80": "^1.15"
+ "symfony/polyfill-php80": "^1.16"
},
"type": "library",
"autoload": {
@@ -3364,7 +3738,7 @@
"options"
],
"support": {
- "source": "https://github.com/symfony/options-resolver/tree/v5.2.3"
+ "source": "https://github.com/symfony/options-resolver/tree/v5.4.21"
},
"funding": [
{
@@ -3380,32 +3754,35 @@
"type": "tidelift"
}
],
- "time": "2021-01-27T12:56:27+00:00"
+ "time": "2023-02-14T08:03:56+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.22.1",
+ "version": "v1.28.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
+ "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
- "reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
+ "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-ctype": "*"
+ },
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.22-dev"
+ "dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3413,12 +3790,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Ctype\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3443,7 +3820,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
},
"funding": [
{
@@ -3459,20 +3836,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-07T16:49:33+00:00"
+ "time": "2023-01-26T09:26:14+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.22.1",
+ "version": "v1.28.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170"
+ "reference": "875e90aeea2777b6f135677f618529449334a612"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170",
- "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612",
+ "reference": "875e90aeea2777b6f135677f618529449334a612",
"shasum": ""
},
"require": {
@@ -3484,7 +3861,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.22-dev"
+ "dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3492,12 +3869,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3524,7 +3901,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0"
},
"funding": [
{
@@ -3540,20 +3917,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-22T09:19:47+00:00"
+ "time": "2023-01-26T09:26:14+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.22.1",
+ "version": "v1.28.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248"
+ "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248",
- "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
+ "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
"shasum": ""
},
"require": {
@@ -3565,7 +3942,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.22-dev"
+ "dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3573,12 +3950,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
- },
"files": [
"bootstrap.php"
],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
"classmap": [
"Resources/stubs"
]
@@ -3608,7 +3985,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0"
},
"funding": [
{
@@ -3624,32 +4001,35 @@
"type": "tidelift"
}
],
- "time": "2021-01-22T09:19:47+00:00"
+ "time": "2023-01-26T09:26:14+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.22.1",
+ "version": "v1.28.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
+ "reference": "42292d99c55abe617799667f454222c54c60e229"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
- "reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229",
+ "reference": "42292d99c55abe617799667f454222c54c60e229",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-mbstring": "*"
+ },
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.22-dev"
+ "dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3657,12 +4037,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3688,75 +4068,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2021-01-22T09:19:47+00:00"
- },
- {
- "name": "symfony/polyfill-php70",
- "version": "v1.20.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php70.git",
- "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644",
- "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "type": "metapackage",
- "extra": {
- "branch-alias": {
- "dev-main": "1.20-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"
},
"funding": [
{
@@ -3772,20 +4084,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2023-07-28T09:04:16+00:00"
},
{
- "name": "symfony/polyfill-php72",
- "version": "v1.22.1",
+ "name": "symfony/polyfill-php73",
+ "version": "v1.28.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php72.git",
- "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9"
+ "url": "https://github.com/symfony/polyfill-php73.git",
+ "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9",
- "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5",
+ "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5",
"shasum": ""
},
"require": {
@@ -3794,7 +4106,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.22-dev"
+ "dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3802,11 +4114,14 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php72\\": ""
- },
"files": [
"bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php73\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -3823,7 +4138,7 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
@@ -3832,7 +4147,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0"
},
"funding": [
{
@@ -3848,20 +4163,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-07T16:49:33+00:00"
+ "time": "2023-01-26T09:26:14+00:00"
},
{
- "name": "symfony/polyfill-php73",
- "version": "v1.22.1",
+ "name": "symfony/polyfill-php80",
+ "version": "v1.28.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2"
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2",
- "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
+ "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
"shasum": ""
},
"require": {
@@ -3870,7 +4185,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.22-dev"
+ "dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3878,12 +4193,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php73\\": ""
- },
"files": [
"bootstrap.php"
],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
"classmap": [
"Resources/stubs"
]
@@ -3893,6 +4208,10 @@
"MIT"
],
"authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
@@ -3902,7 +4221,7 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
@@ -3911,7 +4230,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0"
},
"funding": [
{
@@ -3927,20 +4246,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-07T16:49:33+00:00"
+ "time": "2023-01-26T09:26:14+00:00"
},
{
- "name": "symfony/polyfill-php80",
- "version": "v1.22.1",
+ "name": "symfony/polyfill-php81",
+ "version": "v1.28.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91"
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91",
- "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b",
+ "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b",
"shasum": ""
},
"require": {
@@ -3949,7 +4268,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.22-dev"
+ "dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3957,12 +4276,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
"files": [
"bootstrap.php"
],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php81\\": ""
+ },
"classmap": [
"Resources/stubs"
]
@@ -3972,10 +4291,6 @@
"MIT"
],
"authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
@@ -3985,7 +4300,7 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
@@ -3994,7 +4309,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0"
},
"funding": [
{
@@ -4010,25 +4325,25 @@
"type": "tidelift"
}
],
- "time": "2021-01-07T16:49:33+00:00"
+ "time": "2023-01-26T09:26:14+00:00"
},
{
"name": "symfony/process",
- "version": "v5.2.3",
+ "version": "v5.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f"
+ "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f",
- "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f",
+ "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b",
+ "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.15"
+ "symfony/polyfill-php80": "^1.16"
},
"type": "library",
"autoload": {
@@ -4056,7 +4371,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v5.2.3"
+ "source": "https://github.com/symfony/process/tree/v5.4.28"
},
"funding": [
{
@@ -4072,25 +4387,29 @@
"type": "tidelift"
}
],
- "time": "2021-01-27T10:15:41+00:00"
+ "time": "2023-08-07T10:36:04+00:00"
},
{
"name": "symfony/service-contracts",
- "version": "v2.2.0",
+ "version": "v2.5.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1"
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1",
- "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "psr/container": "^1.0"
+ "psr/container": "^1.1",
+ "symfony/deprecation-contracts": "^2.1|^3"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
},
"suggest": {
"symfony/service-implementation": ""
@@ -4098,7 +4417,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -4135,7 +4454,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/master"
+ "source": "https://github.com/symfony/service-contracts/tree/v2.5.2"
},
"funding": [
{
@@ -4151,25 +4470,25 @@
"type": "tidelift"
}
],
- "time": "2020-09-07T11:33:47+00:00"
+ "time": "2022-05-30T19:17:29+00:00"
},
{
"name": "symfony/stopwatch",
- "version": "v5.2.3",
+ "version": "v5.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
- "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c"
+ "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b12274acfab9d9850c52583d136a24398cdf1a0c",
- "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f83692cd869a6f2391691d40a01e8acb89e76fee",
+ "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/service-contracts": "^1.0|^2"
+ "symfony/service-contracts": "^1|^2|^3"
},
"type": "library",
"autoload": {
@@ -4197,7 +4516,7 @@
"description": "Provides a way to profile code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/stopwatch/tree/v5.2.3"
+ "source": "https://github.com/symfony/stopwatch/tree/v5.4.21"
},
"funding": [
{
@@ -4213,20 +4532,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-27T10:15:41+00:00"
+ "time": "2023-02-14T08:03:56+00:00"
},
{
"name": "symfony/string",
- "version": "v5.2.3",
+ "version": "v5.4.29",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "c95468897f408dd0aca2ff582074423dd0455122"
+ "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122",
- "reference": "c95468897f408dd0aca2ff582074423dd0455122",
+ "url": "https://api.github.com/repos/symfony/string/zipball/e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
+ "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
"shasum": ""
},
"require": {
@@ -4237,20 +4556,23 @@
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php80": "~1.15"
},
+ "conflict": {
+ "symfony/translation-contracts": ">=3.0"
+ },
"require-dev": {
- "symfony/error-handler": "^4.4|^5.0",
- "symfony/http-client": "^4.4|^5.0",
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/http-client": "^4.4|^5.0|^6.0",
"symfony/translation-contracts": "^1.1|^2",
- "symfony/var-exporter": "^4.4|^5.0"
+ "symfony/var-exporter": "^4.4|^5.0|^6.0"
},
"type": "library",
"autoload": {
- "psr-4": {
- "Symfony\\Component\\String\\": ""
- },
"files": [
"Resources/functions.php"
],
+ "psr-4": {
+ "Symfony\\Component\\String\\": ""
+ },
"exclude-from-classmap": [
"/Tests/"
]
@@ -4280,7 +4602,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.2.3"
+ "source": "https://github.com/symfony/string/tree/v5.4.29"
},
"funding": [
{
@@ -4296,20 +4618,20 @@
"type": "tidelift"
}
],
- "time": "2021-01-25T15:14:59+00:00"
+ "time": "2023-09-13T11:47:41+00:00"
},
{
"name": "theseer/tokenizer",
- "version": "1.2.0",
+ "version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
- "reference": "75a63c33a8577608444246075ea0af0d052e452a"
+ "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a",
- "reference": "75a63c33a8577608444246075ea0af0d052e452a",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
"shasum": ""
},
"require": {
@@ -4338,7 +4660,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": {
"issues": "https://github.com/theseer/tokenizer/issues",
- "source": "https://github.com/theseer/tokenizer/tree/master"
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
},
"funding": [
{
@@ -4346,34 +4668,148 @@
"type": "github"
}
],
- "time": "2020-07-12T23:59:07+00:00"
+ "time": "2021-07-28T10:34:58+00:00"
+ },
+ {
+ "name": "vimeo/psalm",
+ "version": "5.15.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/vimeo/psalm.git",
+ "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/vimeo/psalm/zipball/5c774aca4746caf3d239d9c8cadb9f882ca29352",
+ "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352",
+ "shasum": ""
+ },
+ "require": {
+ "amphp/amp": "^2.4.2",
+ "amphp/byte-stream": "^1.5",
+ "composer-runtime-api": "^2",
+ "composer/semver": "^1.4 || ^2.0 || ^3.0",
+ "composer/xdebug-handler": "^2.0 || ^3.0",
+ "dnoegel/php-xdg-base-dir": "^0.1.1",
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "felixfbecker/advanced-json-rpc": "^3.1",
+ "felixfbecker/language-server-protocol": "^1.5.2",
+ "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1",
+ "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
+ "nikic/php-parser": "^4.16",
+ "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
+ "sebastian/diff": "^4.0 || ^5.0",
+ "spatie/array-to-xml": "^2.17.0 || ^3.0",
+ "symfony/console": "^4.1.6 || ^5.0 || ^6.0",
+ "symfony/filesystem": "^5.4 || ^6.0"
+ },
+ "conflict": {
+ "nikic/php-parser": "4.17.0"
+ },
+ "provide": {
+ "psalm/psalm": "self.version"
+ },
+ "require-dev": {
+ "amphp/phpunit-util": "^2.0",
+ "bamarni/composer-bin-plugin": "^1.4",
+ "brianium/paratest": "^6.9",
+ "ext-curl": "*",
+ "mockery/mockery": "^1.5",
+ "nunomaduro/mock-final-classes": "^1.1",
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/phpdoc-parser": "^1.6",
+ "phpunit/phpunit": "^9.6",
+ "psalm/plugin-mockery": "^1.1",
+ "psalm/plugin-phpunit": "^0.18",
+ "slevomat/coding-standard": "^8.4",
+ "squizlabs/php_codesniffer": "^3.6",
+ "symfony/process": "^4.4 || ^5.0 || ^6.0"
+ },
+ "suggest": {
+ "ext-curl": "In order to send data to shepherd",
+ "ext-igbinary": "^2.0.5 is required, used to serialize caching data"
+ },
+ "bin": [
+ "psalm",
+ "psalm-language-server",
+ "psalm-plugin",
+ "psalm-refactor",
+ "psalter"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.x-dev",
+ "dev-4.x": "4.x-dev",
+ "dev-3.x": "3.x-dev",
+ "dev-2.x": "2.x-dev",
+ "dev-1.x": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psalm\\": "src/Psalm/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Matthew Brown"
+ }
+ ],
+ "description": "A static analysis tool for finding errors in PHP applications",
+ "keywords": [
+ "code",
+ "inspection",
+ "php",
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/vimeo/psalm/issues",
+ "source": "https://github.com/vimeo/psalm/tree/5.15.0"
+ },
+ "time": "2023-08-20T23:07:30+00:00"
},
{
"name": "webmozart/assert",
- "version": "1.9.1",
+ "version": "1.11.0",
"source": {
"type": "git",
"url": "https://github.com/webmozarts/assert.git",
- "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
- "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
+ "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991",
+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0 || ^8.0",
- "symfony/polyfill-ctype": "^1.8"
+ "ext-ctype": "*",
+ "php": "^7.2 || ^8.0"
},
"conflict": {
"phpstan/phpstan": "<0.12.20",
- "vimeo/psalm": "<3.9.1"
+ "vimeo/psalm": "<4.6.1 || 4.6.2"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.36 || ^7.5.13"
+ "phpunit/phpunit": "^8.5.13"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.10-dev"
+ }
+ },
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
@@ -4397,21 +4833,19 @@
],
"support": {
"issues": "https://github.com/webmozarts/assert/issues",
- "source": "https://github.com/webmozarts/assert/tree/1.9.1"
+ "source": "https://github.com/webmozarts/assert/tree/1.11.0"
},
- "time": "2020-07-08T17:02:28+00:00"
+ "time": "2022-06-03T18:03:27+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": {
- "ekino/phpstan-banned-code": 20
- },
+ "stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^8"
},
"platform-dev": [],
- "plugin-api-version": "2.0.0"
+ "plugin-api-version": "2.6.0"
}
diff --git a/phpstan.neon b/phpstan.neon
index 853b4e0..e8ea28d 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -1,4 +1,8 @@
parameters:
paths:
- src/
- level: 5
+ level: max
+ ignoreErrors:
+ - '#Property Undabot\\JsonApi\\Util\\Exception\\ValidationException::\$constraints is never read, only written.#'
+ - '#Property Undabot\\JsonApi\\Util\\Exception\\ValidationException::\$propertyPath is never read, only written.#'
+ - '#Property Undabot\\JsonApi\\Util\\Exception\\ValidationException::\$value is never read, only written.#'
diff --git a/psalm.xml b/psalm.xml
new file mode 100644
index 0000000..22b7de8
--- /dev/null
+++ b/psalm.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/Definition/Encoding/AttributeCollectionToPhpArrayEncoderInterface.php b/src/Definition/Encoding/AttributeCollectionToPhpArrayEncoderInterface.php
index fee8c38..35043a1 100644
--- a/src/Definition/Encoding/AttributeCollectionToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/AttributeCollectionToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface AttributeCollectionToPhpArrayEncoderInterface
{
- public function encode(AttributeCollectionInterface $attributeCollection);
+ /** @return array */
+ public function encode(AttributeCollectionInterface $attributeCollection): array;
}
diff --git a/src/Definition/Encoding/DocumentDataToPhpArrayEncoderInterface.php b/src/Definition/Encoding/DocumentDataToPhpArrayEncoderInterface.php
index 63a08e9..ce6fed8 100644
--- a/src/Definition/Encoding/DocumentDataToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/DocumentDataToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface DocumentDataToPhpArrayEncoderInterface
{
- public function encode(DocumentDataInterface $documentData);
+ /** @return null|array */
+ public function encode(DocumentDataInterface $documentData): ?array;
}
diff --git a/src/Definition/Encoding/DocumentToPhpArrayEncoderInterface.php b/src/Definition/Encoding/DocumentToPhpArrayEncoderInterface.php
index 726dc32..41d0355 100644
--- a/src/Definition/Encoding/DocumentToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/DocumentToPhpArrayEncoderInterface.php
@@ -8,5 +8,10 @@
interface DocumentToPhpArrayEncoderInterface
{
- public function encode(DocumentInterface $document);
+ /**
+ * @return array
+ *
+ * @psalm-suppress PossiblyUnusedMethod
+ */
+ public function encode(DocumentInterface $document): array;
}
diff --git a/src/Definition/Encoding/ErrorCollectionToPhpArrayEncoderInterface.php b/src/Definition/Encoding/ErrorCollectionToPhpArrayEncoderInterface.php
index 539e270..8fb8312 100644
--- a/src/Definition/Encoding/ErrorCollectionToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/ErrorCollectionToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface ErrorCollectionToPhpArrayEncoderInterface
{
- public function encode(ErrorCollectionInterface $errorCollection);
+ /** @return array> */
+ public function encode(ErrorCollectionInterface $errorCollection): array;
}
diff --git a/src/Definition/Encoding/ErrorToPhpArrayEncoderInterface.php b/src/Definition/Encoding/ErrorToPhpArrayEncoderInterface.php
index 6ab86b9..2783c4f 100644
--- a/src/Definition/Encoding/ErrorToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/ErrorToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface ErrorToPhpArrayEncoderInterface
{
+ /** @return array */
public function encode(ErrorInterface $error): array;
}
diff --git a/src/Definition/Encoding/LinkCollectionToPhpArrayEncoderInterface.php b/src/Definition/Encoding/LinkCollectionToPhpArrayEncoderInterface.php
index 7aeabc2..913580d 100644
--- a/src/Definition/Encoding/LinkCollectionToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/LinkCollectionToPhpArrayEncoderInterface.php
@@ -8,5 +8,8 @@
interface LinkCollectionToPhpArrayEncoderInterface
{
+ /**
+ * @return array
+ */
public function encode(LinkCollectionInterface $linkCollection): array;
}
diff --git a/src/Definition/Encoding/LinkToPhpArrayEncoderInterface.php b/src/Definition/Encoding/LinkToPhpArrayEncoderInterface.php
index 7b2f867..21d9752 100644
--- a/src/Definition/Encoding/LinkToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/LinkToPhpArrayEncoderInterface.php
@@ -8,5 +8,8 @@
interface LinkToPhpArrayEncoderInterface
{
+ /**
+ * @return null|array|string
+ */
public function encode(LinkInterface $link);
}
diff --git a/src/Definition/Encoding/MetaToPhpArrayEncoderInterface.php b/src/Definition/Encoding/MetaToPhpArrayEncoderInterface.php
index 07b7163..5042f4a 100644
--- a/src/Definition/Encoding/MetaToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/MetaToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface MetaToPhpArrayEncoderInterface
{
- public function encode(MetaInterface $meta);
+ /** @return array */
+ public function encode(MetaInterface $meta): array;
}
diff --git a/src/Definition/Encoding/PhpArrayToAttributeCollectionEncoderInterface.php b/src/Definition/Encoding/PhpArrayToAttributeCollectionEncoderInterface.php
index bb0e184..d5125a3 100644
--- a/src/Definition/Encoding/PhpArrayToAttributeCollectionEncoderInterface.php
+++ b/src/Definition/Encoding/PhpArrayToAttributeCollectionEncoderInterface.php
@@ -8,5 +8,8 @@
interface PhpArrayToAttributeCollectionEncoderInterface
{
+ /**
+ * @param array $attributes
+ */
public function encode(array $attributes): AttributeCollectionInterface;
}
diff --git a/src/Definition/Encoding/PhpArrayToLinkCollectionEncoderInterface.php b/src/Definition/Encoding/PhpArrayToLinkCollectionEncoderInterface.php
index bd69a89..c54b887 100644
--- a/src/Definition/Encoding/PhpArrayToLinkCollectionEncoderInterface.php
+++ b/src/Definition/Encoding/PhpArrayToLinkCollectionEncoderInterface.php
@@ -8,5 +8,6 @@
interface PhpArrayToLinkCollectionEncoderInterface
{
+ /** @param array $links */
public function encode(array $links): LinkCollectionInterface;
}
diff --git a/src/Definition/Encoding/PhpArrayToMetaEncoderInterface.php b/src/Definition/Encoding/PhpArrayToMetaEncoderInterface.php
index 247f0d2..ce4d1f0 100644
--- a/src/Definition/Encoding/PhpArrayToMetaEncoderInterface.php
+++ b/src/Definition/Encoding/PhpArrayToMetaEncoderInterface.php
@@ -8,5 +8,6 @@
interface PhpArrayToMetaEncoderInterface
{
+ /** @param array $meta */
public function decode(array $meta): MetaInterface;
}
diff --git a/src/Definition/Encoding/PhpArrayToRelationshipCollectionEncoderInterface.php b/src/Definition/Encoding/PhpArrayToRelationshipCollectionEncoderInterface.php
index b74bf98..9cb8b11 100644
--- a/src/Definition/Encoding/PhpArrayToRelationshipCollectionEncoderInterface.php
+++ b/src/Definition/Encoding/PhpArrayToRelationshipCollectionEncoderInterface.php
@@ -5,8 +5,14 @@
namespace Undabot\JsonApi\Definition\Encoding;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\RelationshipCollectionInterface;
+use Undabot\JsonApi\Implementation\Encoding\Exception\JsonApiEncodingException;
interface PhpArrayToRelationshipCollectionEncoderInterface
{
+ /**
+ * @param array> $relationships
+ *
+ * @throws JsonApiEncodingException
+ */
public function encode(array $relationships): RelationshipCollectionInterface;
}
diff --git a/src/Definition/Encoding/PhpArrayToResourceEncoderInterface.php b/src/Definition/Encoding/PhpArrayToResourceEncoderInterface.php
index 8b35e85..77a79af 100644
--- a/src/Definition/Encoding/PhpArrayToResourceEncoderInterface.php
+++ b/src/Definition/Encoding/PhpArrayToResourceEncoderInterface.php
@@ -10,7 +10,11 @@
interface PhpArrayToResourceEncoderInterface
{
/**
+ * @param array $resource
+ *
* @throws JsonApiEncodingException
+ *
+ * @psalm-suppress PossiblyUnusedMethod
*/
public function decode(array $resource): ResourceInterface;
}
diff --git a/src/Definition/Encoding/RelationshipCollectionToPhpArrayEncoderInterface.php b/src/Definition/Encoding/RelationshipCollectionToPhpArrayEncoderInterface.php
index 1383e14..647ddf2 100644
--- a/src/Definition/Encoding/RelationshipCollectionToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/RelationshipCollectionToPhpArrayEncoderInterface.php
@@ -8,5 +8,8 @@
interface RelationshipCollectionToPhpArrayEncoderInterface
{
- public function encode(RelationshipCollectionInterface $relationship);
+ /**
+ * @return array
+ */
+ public function encode(RelationshipCollectionInterface $relationships): array;
}
diff --git a/src/Definition/Encoding/RelationshipToPhpArrayEncoderInterface.php b/src/Definition/Encoding/RelationshipToPhpArrayEncoderInterface.php
index 173013b..c7c315d 100644
--- a/src/Definition/Encoding/RelationshipToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/RelationshipToPhpArrayEncoderInterface.php
@@ -8,5 +8,8 @@
interface RelationshipToPhpArrayEncoderInterface
{
- public function encode(RelationshipInterface $relationship);
+ /**
+ * @return array
+ */
+ public function encode(RelationshipInterface $relationship): array;
}
diff --git a/src/Definition/Encoding/ResourceCollectionToPhpArrayEncoderInterface.php b/src/Definition/Encoding/ResourceCollectionToPhpArrayEncoderInterface.php
index cc37818..4dbedcf 100644
--- a/src/Definition/Encoding/ResourceCollectionToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/ResourceCollectionToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface ResourceCollectionToPhpArrayEncoderInterface
{
- public function encode(ResourceCollectionInterface $resource);
+ /** @return array> */
+ public function encode(ResourceCollectionInterface $resources): array;
}
diff --git a/src/Definition/Encoding/ResourceIdentifierCollectionToPhpArrayEncoderInterface.php b/src/Definition/Encoding/ResourceIdentifierCollectionToPhpArrayEncoderInterface.php
index dee923d..6f6de8a 100644
--- a/src/Definition/Encoding/ResourceIdentifierCollectionToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/ResourceIdentifierCollectionToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface ResourceIdentifierCollectionToPhpArrayEncoderInterface
{
- public function encode(ResourceIdentifierCollectionInterface $resourceIdentifierCollection);
+ /** @return array> */
+ public function encode(ResourceIdentifierCollectionInterface $resourceIdentifierCollection): array;
}
diff --git a/src/Definition/Encoding/ResourceIdentifierToPhpArrayEncoderInterface.php b/src/Definition/Encoding/ResourceIdentifierToPhpArrayEncoderInterface.php
index 8c25de6..dca92f0 100644
--- a/src/Definition/Encoding/ResourceIdentifierToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/ResourceIdentifierToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface ResourceIdentifierToPhpArrayEncoderInterface
{
- public function encode(ResourceIdentifierInterface $resourceIdentifier);
+ /** @return array */
+ public function encode(ResourceIdentifierInterface $resourceIdentifier): array;
}
diff --git a/src/Definition/Encoding/ResourceToPhpArrayEncoderInterface.php b/src/Definition/Encoding/ResourceToPhpArrayEncoderInterface.php
index f2fc448..3e62ff9 100644
--- a/src/Definition/Encoding/ResourceToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/ResourceToPhpArrayEncoderInterface.php
@@ -8,5 +8,6 @@
interface ResourceToPhpArrayEncoderInterface
{
- public function encode(ResourceInterface $resource);
+ /** @return array */
+ public function encode(ResourceInterface $resource): array;
}
diff --git a/src/Definition/Encoding/SourceToPhpArrayEncoderInterface.php b/src/Definition/Encoding/SourceToPhpArrayEncoderInterface.php
index e4bb1a5..be421e7 100644
--- a/src/Definition/Encoding/SourceToPhpArrayEncoderInterface.php
+++ b/src/Definition/Encoding/SourceToPhpArrayEncoderInterface.php
@@ -8,5 +8,8 @@
interface SourceToPhpArrayEncoderInterface
{
- public function encode(SourceInterface $source);
+ /**
+ * @return array
+ */
+ public function encode(SourceInterface $source): array;
}
diff --git a/src/Definition/Exception/JsonApiDecodeException.php b/src/Definition/Exception/JsonApiDecodeException.php
index 237867f..17b65fa 100644
--- a/src/Definition/Exception/JsonApiDecodeException.php
+++ b/src/Definition/Exception/JsonApiDecodeException.php
@@ -4,8 +4,5 @@
namespace Undabot\JsonApi\Definition\Exception;
-use Exception;
-
-class JsonApiDecodeException extends Exception
-{
-}
+/** @psalm-suppress UnusedClass */
+class JsonApiDecodeException extends \Exception {}
diff --git a/src/Definition/Exception/Request/ClientGeneratedIdIsNotAllowedException.php b/src/Definition/Exception/Request/ClientGeneratedIdIsNotAllowedException.php
index 82a9918..c71260f 100644
--- a/src/Definition/Exception/Request/ClientGeneratedIdIsNotAllowedException.php
+++ b/src/Definition/Exception/Request/ClientGeneratedIdIsNotAllowedException.php
@@ -4,6 +4,5 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class ClientGeneratedIdIsNotAllowedException extends RequestException
-{
-}
+/** @psalm-suppress UnusedClass */
+class ClientGeneratedIdIsNotAllowedException extends RequestException {}
diff --git a/src/Definition/Exception/Request/InvalidRequestAcceptHeaderException.php b/src/Definition/Exception/Request/InvalidRequestAcceptHeaderException.php
index 25c1bb1..a41deb9 100644
--- a/src/Definition/Exception/Request/InvalidRequestAcceptHeaderException.php
+++ b/src/Definition/Exception/Request/InvalidRequestAcceptHeaderException.php
@@ -4,6 +4,5 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class InvalidRequestAcceptHeaderException extends RequestException
-{
-}
+/** @psalm-suppress UnusedClass */
+class InvalidRequestAcceptHeaderException extends RequestException {}
diff --git a/src/Definition/Exception/Request/InvalidRequestContentTypeHeaderException.php b/src/Definition/Exception/Request/InvalidRequestContentTypeHeaderException.php
index 4835e4b..82d08f5 100644
--- a/src/Definition/Exception/Request/InvalidRequestContentTypeHeaderException.php
+++ b/src/Definition/Exception/Request/InvalidRequestContentTypeHeaderException.php
@@ -4,6 +4,4 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class InvalidRequestContentTypeHeaderException extends RequestException
-{
-}
+class InvalidRequestContentTypeHeaderException extends RequestException {}
diff --git a/src/Definition/Exception/Request/InvalidRequestDataException.php b/src/Definition/Exception/Request/InvalidRequestDataException.php
index b7936bf..2f9e257 100644
--- a/src/Definition/Exception/Request/InvalidRequestDataException.php
+++ b/src/Definition/Exception/Request/InvalidRequestDataException.php
@@ -4,6 +4,5 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class InvalidRequestDataException extends RequestException
-{
-}
+/** @psalm-suppress UnusedClass */
+class InvalidRequestDataException extends RequestException {}
diff --git a/src/Definition/Exception/Request/RequestException.php b/src/Definition/Exception/Request/RequestException.php
index dc47624..2ff2d75 100644
--- a/src/Definition/Exception/Request/RequestException.php
+++ b/src/Definition/Exception/Request/RequestException.php
@@ -4,6 +4,4 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class RequestException extends \RuntimeException
-{
-}
+class RequestException extends \RuntimeException {}
diff --git a/src/Definition/Exception/Request/UnsupportedFilterAttributeGivenException.php b/src/Definition/Exception/Request/UnsupportedFilterAttributeGivenException.php
index e02694b..5807bd0 100644
--- a/src/Definition/Exception/Request/UnsupportedFilterAttributeGivenException.php
+++ b/src/Definition/Exception/Request/UnsupportedFilterAttributeGivenException.php
@@ -4,15 +4,17 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-use Throwable;
-
+/** @psalm-suppress UnusedClass */
class UnsupportedFilterAttributeGivenException extends RequestException
{
+ /**
+ * @param string[] $unsupportedFilters
+ */
public function __construct(
array $unsupportedFilters,
?string $message = null,
- $code = 0,
- Throwable $previous = null
+ int $code = 0,
+ \Throwable $previous = null
) {
if (null === $message) {
$message = sprintf('Unsupported filters given: `%s`', implode(', ', $unsupportedFilters));
diff --git a/src/Definition/Exception/Request/UnsupportedIncludeValuesGivenException.php b/src/Definition/Exception/Request/UnsupportedIncludeValuesGivenException.php
index 964aeeb..690043b 100644
--- a/src/Definition/Exception/Request/UnsupportedIncludeValuesGivenException.php
+++ b/src/Definition/Exception/Request/UnsupportedIncludeValuesGivenException.php
@@ -4,15 +4,17 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-use Throwable;
-
+/** @psalm-suppress UnusedClass */
class UnsupportedIncludeValuesGivenException extends RequestException
{
+ /**
+ * @param string[] $unsupportedIncludes
+ */
public function __construct(
array $unsupportedIncludes,
?string $message = null,
- $code = 0,
- Throwable $previous = null
+ int $code = 0,
+ \Throwable $previous = null
) {
if (null === $message) {
$message = sprintf(
diff --git a/src/Definition/Exception/Request/UnsupportedMediaTypeException.php b/src/Definition/Exception/Request/UnsupportedMediaTypeException.php
index 524e38d..2203c07 100644
--- a/src/Definition/Exception/Request/UnsupportedMediaTypeException.php
+++ b/src/Definition/Exception/Request/UnsupportedMediaTypeException.php
@@ -4,6 +4,5 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class UnsupportedMediaTypeException extends InvalidRequestContentTypeHeaderException
-{
-}
+/** @psalm-suppress UnusedClass */
+class UnsupportedMediaTypeException extends InvalidRequestContentTypeHeaderException {}
diff --git a/src/Definition/Exception/Request/UnsupportedPaginationRequestedException.php b/src/Definition/Exception/Request/UnsupportedPaginationRequestedException.php
index 2993946..707a5be 100644
--- a/src/Definition/Exception/Request/UnsupportedPaginationRequestedException.php
+++ b/src/Definition/Exception/Request/UnsupportedPaginationRequestedException.php
@@ -4,6 +4,5 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class UnsupportedPaginationRequestedException extends RequestException
-{
-}
+/** @psalm-suppress UnusedClass */
+class UnsupportedPaginationRequestedException extends RequestException {}
diff --git a/src/Definition/Exception/Request/UnsupportedQueryStringParameterGivenException.php b/src/Definition/Exception/Request/UnsupportedQueryStringParameterGivenException.php
index 24db4b8..9ec2c61 100644
--- a/src/Definition/Exception/Request/UnsupportedQueryStringParameterGivenException.php
+++ b/src/Definition/Exception/Request/UnsupportedQueryStringParameterGivenException.php
@@ -4,6 +4,5 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-class UnsupportedQueryStringParameterGivenException extends RequestException
-{
-}
+/** @psalm-suppress UnusedClass */
+class UnsupportedQueryStringParameterGivenException extends RequestException {}
diff --git a/src/Definition/Exception/Request/UnsupportedSortRequestedException.php b/src/Definition/Exception/Request/UnsupportedSortRequestedException.php
index ff96686..e66fa94 100644
--- a/src/Definition/Exception/Request/UnsupportedSortRequestedException.php
+++ b/src/Definition/Exception/Request/UnsupportedSortRequestedException.php
@@ -4,12 +4,18 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-use Throwable;
-
+/** @psalm-suppress UnusedClass */
class UnsupportedSortRequestedException extends RequestException
{
- public function __construct(array $unsupportedSorts, ?string $message = null, $code = 0, Throwable $previous = null)
- {
+ /**
+ * @param string[] $unsupportedSorts
+ */
+ public function __construct(
+ array $unsupportedSorts,
+ ?string $message = null,
+ int $code = 0,
+ \Throwable $previous = null
+ ) {
if (null === $message) {
$message = sprintf(
'Unsupported sort query params given: `%s`',
diff --git a/src/Definition/Exception/Request/UnsupportedSparseFieldsetRequestedException.php b/src/Definition/Exception/Request/UnsupportedSparseFieldsetRequestedException.php
index a79ea73..4259bac 100644
--- a/src/Definition/Exception/Request/UnsupportedSparseFieldsetRequestedException.php
+++ b/src/Definition/Exception/Request/UnsupportedSparseFieldsetRequestedException.php
@@ -4,15 +4,17 @@
namespace Undabot\JsonApi\Definition\Exception\Request;
-use Throwable;
-
+/** @psalm-suppress UnusedClass */
class UnsupportedSparseFieldsetRequestedException extends RequestException
{
+ /**
+ * @param string[] $unsupportedIncludes
+ */
public function __construct(
array $unsupportedIncludes,
?string $message = null,
- $code = 0,
- Throwable $previous = null
+ int $code = 0,
+ \Throwable $previous = null
) {
if (null === $message) {
$message = sprintf(
diff --git a/src/Definition/Model/Document/DocumentDataInterface.php b/src/Definition/Model/Document/DocumentDataInterface.php
index a196dd1..d5421ff 100644
--- a/src/Definition/Model/Document/DocumentDataInterface.php
+++ b/src/Definition/Model/Document/DocumentDataInterface.php
@@ -19,6 +19,7 @@ public function isResourceCollection(): bool;
public function isResourceIdentifierCollection(): bool;
+ /** @psalm-suppress PossiblyUnusedMethod */
public function isEmpty(): bool;
public function getResource(): ResourceInterface;
diff --git a/src/Definition/Model/Error/ErrorCollectionInterface.php b/src/Definition/Model/Error/ErrorCollectionInterface.php
index 3897167..9cb454a 100644
--- a/src/Definition/Model/Error/ErrorCollectionInterface.php
+++ b/src/Definition/Model/Error/ErrorCollectionInterface.php
@@ -6,7 +6,11 @@
use IteratorAggregate;
-interface ErrorCollectionInterface extends IteratorAggregate
+/**
+ * @extends IteratorAggregate
+ */
+interface ErrorCollectionInterface extends \IteratorAggregate
{
+ /** @return ErrorInterface[] */
public function getErrors(): array;
}
diff --git a/src/Definition/Model/Link/LinkCollectionInterface.php b/src/Definition/Model/Link/LinkCollectionInterface.php
index cef5d86..a513331 100644
--- a/src/Definition/Model/Link/LinkCollectionInterface.php
+++ b/src/Definition/Model/Link/LinkCollectionInterface.php
@@ -6,13 +6,24 @@
use IteratorAggregate;
-interface LinkCollectionInterface extends IteratorAggregate
+/**
+ * @extends IteratorAggregate
+ */
+interface LinkCollectionInterface extends \IteratorAggregate
{
+ /** @psalm-suppress PossiblyUnusedMethod */
public function hasLink(string $linkName): bool;
+ /** @psalm-suppress PossiblyUnusedMethod */
public function getLink(string $linkName): ?LinkInterface;
+ /** @return string[] */
public function getLinkNames(): array;
+ /**
+ * @psalm-suppress PossiblyUnusedMethod
+ *
+ * @return LinkInterface[]
+ */
public function getLinks(): array;
}
diff --git a/src/Definition/Model/Link/LinkMemberInterface.php b/src/Definition/Model/Link/LinkMemberInterface.php
index cc3db5b..ca51cd8 100644
--- a/src/Definition/Model/Link/LinkMemberInterface.php
+++ b/src/Definition/Model/Link/LinkMemberInterface.php
@@ -4,6 +4,4 @@
namespace Undabot\JsonApi\Definition\Model\Link;
-interface LinkMemberInterface
-{
-}
+interface LinkMemberInterface {}
diff --git a/src/Definition/Model/Link/LinkNamesEnum.php b/src/Definition/Model/Link/LinkNamesEnum.php
index 180b4a3..6789248 100644
--- a/src/Definition/Model/Link/LinkNamesEnum.php
+++ b/src/Definition/Model/Link/LinkNamesEnum.php
@@ -4,8 +4,6 @@
namespace Undabot\JsonApi\Definition\Model\Link;
-use ReflectionClass;
-
abstract class LinkNamesEnum
{
public const LINK_NAME_SELF = 'self';
@@ -17,9 +15,10 @@ abstract class LinkNamesEnum
public const LINK_NAME_PAGINATION_PREV = 'prev';
public const LINK_NAME_PAGINATION_NEXT = 'next';
+ /** @return array */
public static function getValues(): array
{
- $oClass = new ReflectionClass(__CLASS__);
+ $oClass = new \ReflectionClass(__CLASS__);
return $oClass->getConstants();
}
diff --git a/src/Definition/Model/Meta/MetaInterface.php b/src/Definition/Model/Meta/MetaInterface.php
index 0fa1fd1..9371217 100644
--- a/src/Definition/Model/Meta/MetaInterface.php
+++ b/src/Definition/Model/Meta/MetaInterface.php
@@ -6,5 +6,6 @@
interface MetaInterface
{
+ /** @return array */
public function getData(): array;
}
diff --git a/src/Definition/Model/Request/CreateResourceRequestInterface.php b/src/Definition/Model/Request/CreateResourceRequestInterface.php
index 88f3067..3a415b7 100644
--- a/src/Definition/Model/Request/CreateResourceRequestInterface.php
+++ b/src/Definition/Model/Request/CreateResourceRequestInterface.php
@@ -4,6 +4,5 @@
namespace Undabot\JsonApi\Definition\Model\Request;
-interface CreateResourceRequestInterface extends ResourcePayloadRequest
-{
-}
+/** @psalm-api */
+interface CreateResourceRequestInterface extends ResourcePayloadRequest {}
diff --git a/src/Definition/Model/Request/GetResourceCollectionRequestInterface.php b/src/Definition/Model/Request/GetResourceCollectionRequestInterface.php
deleted file mode 100644
index 51c3db4..0000000
--- a/src/Definition/Model/Request/GetResourceCollectionRequestInterface.php
+++ /dev/null
@@ -1,52 +0,0 @@
-
+ */
+interface AttributeCollectionInterface extends \IteratorAggregate
{
+ /** @return AttributeInterface[] */
public function getAttributes(): array;
+ /** @psalm-suppress PossiblyUnusedMethod */
public function getAttributeByName(string $name): ?AttributeInterface;
}
diff --git a/src/Definition/Model/Resource/Attribute/AttributeInterface.php b/src/Definition/Model/Resource/Attribute/AttributeInterface.php
index af856d2..b6912a7 100644
--- a/src/Definition/Model/Resource/Attribute/AttributeInterface.php
+++ b/src/Definition/Model/Resource/Attribute/AttributeInterface.php
@@ -8,5 +8,5 @@ interface AttributeInterface
{
public function getName(): string;
- public function getValue();
+ public function getValue(): mixed;
}
diff --git a/src/Definition/Model/Resource/Relationship/Data/RelationshipDataInterface.php b/src/Definition/Model/Resource/Relationship/Data/RelationshipDataInterface.php
index 3a67c43..7b74e2f 100644
--- a/src/Definition/Model/Resource/Relationship/Data/RelationshipDataInterface.php
+++ b/src/Definition/Model/Resource/Relationship/Data/RelationshipDataInterface.php
@@ -8,5 +8,5 @@ interface RelationshipDataInterface
{
public function isEmpty(): bool;
- public function getData();
+ public function getData(): mixed;
}
diff --git a/src/Definition/Model/Resource/Relationship/RelationshipCollectionInterface.php b/src/Definition/Model/Resource/Relationship/RelationshipCollectionInterface.php
index cd0d7ea..adfaec5 100644
--- a/src/Definition/Model/Resource/Relationship/RelationshipCollectionInterface.php
+++ b/src/Definition/Model/Resource/Relationship/RelationshipCollectionInterface.php
@@ -6,9 +6,16 @@
use IteratorAggregate;
-interface RelationshipCollectionInterface extends IteratorAggregate
+/**
+ * @extends IteratorAggregate
+ */
+interface RelationshipCollectionInterface extends \IteratorAggregate
{
+ /**
+ * @return RelationshipInterface[]
+ */
public function getRelationships(): array;
+ /** @psalm-suppress PossiblyUnusedMethod */
public function getRelationshipByName(string $name): ?RelationshipInterface;
}
diff --git a/src/Definition/Model/Resource/ResourceCollectionInterface.php b/src/Definition/Model/Resource/ResourceCollectionInterface.php
index 80a35b8..cc9ce64 100644
--- a/src/Definition/Model/Resource/ResourceCollectionInterface.php
+++ b/src/Definition/Model/Resource/ResourceCollectionInterface.php
@@ -6,7 +6,13 @@
use IteratorAggregate;
-interface ResourceCollectionInterface extends IteratorAggregate
+/**
+ * @extends IteratorAggregate
+ */
+interface ResourceCollectionInterface extends \IteratorAggregate
{
+ /**
+ * @return ResourceInterface[] $resources
+ */
public function getResources(): array;
}
diff --git a/src/Definition/Model/Resource/ResourceIdentifierCollectionInterface.php b/src/Definition/Model/Resource/ResourceIdentifierCollectionInterface.php
index 60d0f8a..7635ef5 100644
--- a/src/Definition/Model/Resource/ResourceIdentifierCollectionInterface.php
+++ b/src/Definition/Model/Resource/ResourceIdentifierCollectionInterface.php
@@ -6,7 +6,13 @@
use IteratorAggregate;
-interface ResourceIdentifierCollectionInterface extends IteratorAggregate
+/**
+ * @extends IteratorAggregate
+ */
+interface ResourceIdentifierCollectionInterface extends \IteratorAggregate
{
+ /**
+ * @return ResourceIdentifierInterface[]
+ */
public function getResourceIdentifiers(): array;
}
diff --git a/src/Implementation/Encoding/AttributeCollectionToPhpArrayEncoder.php b/src/Implementation/Encoding/AttributeCollectionToPhpArrayEncoder.php
index 7128a29..9c7efaa 100644
--- a/src/Implementation/Encoding/AttributeCollectionToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/AttributeCollectionToPhpArrayEncoder.php
@@ -6,15 +6,14 @@
use Undabot\JsonApi\Definition\Encoding\AttributeCollectionToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Resource\Attribute\AttributeCollectionInterface;
-use Undabot\JsonApi\Definition\Model\Resource\Attribute\AttributeInterface;
+/** @psalm-suppress UnusedClass */
class AttributeCollectionToPhpArrayEncoder implements AttributeCollectionToPhpArrayEncoderInterface
{
public function encode(AttributeCollectionInterface $attributeCollection): array
{
$serializedAttributes = [];
- /** @var AttributeInterface $attribute */
foreach ($attributeCollection as $attribute) {
$serializedAttributes[$attribute->getName()] = $attribute->getValue();
}
diff --git a/src/Implementation/Encoding/DocumentDataToPhpArrayEncoder.php b/src/Implementation/Encoding/DocumentDataToPhpArrayEncoder.php
index 2f0e148..21aced2 100644
--- a/src/Implementation/Encoding/DocumentDataToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/DocumentDataToPhpArrayEncoder.php
@@ -11,19 +11,16 @@
use Undabot\JsonApi\Definition\Encoding\ResourceToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Document\DocumentDataInterface;
+/** @psalm-suppress UnusedClass */
class DocumentDataToPhpArrayEncoder implements DocumentDataToPhpArrayEncoderInterface
{
- /** @var ResourceToPhpArrayEncoderInterface */
- private $resourceEncoder;
+ private ResourceToPhpArrayEncoderInterface $resourceEncoder;
- /** @var ResourceCollectionToPhpArrayEncoderInterface */
- private $resourceCollectionEncoder;
+ private ResourceCollectionToPhpArrayEncoderInterface $resourceCollectionEncoder;
- /** @var ResourceIdentifierToPhpArrayEncoderInterface */
- private $resourceIdentifierEncoder;
+ private ResourceIdentifierToPhpArrayEncoderInterface $resourceIdentifierEncoder;
- /** @var ResourceIdentifierCollectionToPhpArrayEncoderInterface */
- private $resourceIdentifierCollectionEncoder;
+ private ResourceIdentifierCollectionToPhpArrayEncoderInterface $resourceIdentifierCollectionEncoder;
public function __construct(
ResourceToPhpArrayEncoderInterface $resourceEncoder,
diff --git a/src/Implementation/Encoding/DocumentToPhpArrayEncoder.php b/src/Implementation/Encoding/DocumentToPhpArrayEncoder.php
index 04b6931..49a1f0c 100644
--- a/src/Implementation/Encoding/DocumentToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/DocumentToPhpArrayEncoder.php
@@ -12,22 +12,18 @@
use Undabot\JsonApi\Definition\Encoding\ResourceCollectionToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Document\DocumentInterface;
+/** @psalm-suppress UnusedClass */
class DocumentToPhpArrayEncoder implements DocumentToPhpArrayEncoderInterface
{
- /** @var DocumentDataToPhpArrayEncoderInterface */
- private $documentDataEncoder;
+ private DocumentDataToPhpArrayEncoderInterface $documentDataEncoder;
- /** @var ErrorCollectionToPhpArrayEncoderInterface */
- private $errorCollectionEncoder;
+ private ErrorCollectionToPhpArrayEncoderInterface $errorCollectionEncoder;
- /** @var MetaToPhpArrayEncoderInterface */
- private $metaEncoder;
+ private MetaToPhpArrayEncoderInterface $metaEncoder;
- /** @var LinkCollectionToPhpArrayEncoderInterface */
- private $linkCollectionEncoder;
+ private LinkCollectionToPhpArrayEncoderInterface $linkCollectionEncoder;
- /** @var ResourceCollectionToPhpArrayEncoderInterface */
- private $resourceCollectionEncoder;
+ private ResourceCollectionToPhpArrayEncoderInterface $resourceCollectionEncoder;
public function __construct(
DocumentDataToPhpArrayEncoderInterface $documentDataEncoder,
@@ -43,32 +39,39 @@ public function __construct(
$this->resourceCollectionEncoder = $resourceCollectionEncoder;
}
+ /** @return array */
public function encode(DocumentInterface $document): array
{
$serializedDocument = [];
- if (null !== $document->getJsonApiMeta()) {
- $serializedDocument['jsonapi'] = $this->metaEncoder->encode($document->getJsonApiMeta());
+ $jsonApiMeta = $document->getJsonApiMeta();
+ if (null !== $jsonApiMeta) {
+ $serializedDocument['jsonapi'] = $this->metaEncoder->encode($jsonApiMeta);
}
- if (null !== $document->getErrors()) {
- $serializedDocument['errors'] = $this->errorCollectionEncoder->encode($document->getErrors());
+ $errors = $document->getErrors();
+ if (null !== $errors) {
+ $serializedDocument['errors'] = $this->errorCollectionEncoder->encode($errors);
}
- if (null !== $document->getMeta()) {
- $serializedDocument['meta'] = $this->metaEncoder->encode($document->getMeta());
+ $meta = $document->getMeta();
+ if (null !== $meta) {
+ $serializedDocument['meta'] = $this->metaEncoder->encode($meta);
}
- if (null !== $document->getLinks()) {
- $serializedDocument['links'] = $this->linkCollectionEncoder->encode($document->getLinks());
+ $links = $document->getLinks();
+ if (null !== $links) {
+ $serializedDocument['links'] = $this->linkCollectionEncoder->encode($links);
}
- if (null !== $document->getData()) {
- $serializedDocument['data'] = $this->documentDataEncoder->encode($document->getData());
+ $data = $document->getData();
+ if (null !== $data) {
+ $serializedDocument['data'] = $this->documentDataEncoder->encode($data);
}
- if (null !== $document->getIncluded()) {
- $serializedDocument['included'] = $this->resourceCollectionEncoder->encode($document->getIncluded());
+ $included = $document->getIncluded();
+ if (null !== $included) {
+ $serializedDocument['included'] = $this->resourceCollectionEncoder->encode($included);
}
return $serializedDocument;
diff --git a/src/Implementation/Encoding/ErrorCollectionToPhpArrayEncoder.php b/src/Implementation/Encoding/ErrorCollectionToPhpArrayEncoder.php
index ff824d6..30239b1 100644
--- a/src/Implementation/Encoding/ErrorCollectionToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/ErrorCollectionToPhpArrayEncoder.php
@@ -7,8 +7,8 @@
use Undabot\JsonApi\Definition\Encoding\ErrorCollectionToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Encoding\ErrorToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Error\ErrorCollectionInterface;
-use Undabot\JsonApi\Definition\Model\Error\ErrorInterface;
+/** @psalm-suppress UnusedClass */
class ErrorCollectionToPhpArrayEncoder implements ErrorCollectionToPhpArrayEncoderInterface
{
/** @var ErrorToPhpArrayEncoderInterface */
@@ -19,11 +19,11 @@ public function __construct(ErrorToPhpArrayEncoderInterface $errorEncoder)
$this->errorEncoder = $errorEncoder;
}
+ /** @return array> */
public function encode(ErrorCollectionInterface $errorCollection): array
{
$serializedErrors = [];
- /** @var ErrorInterface $error */
foreach ($errorCollection as $error) {
$serializedErrors[] = $this->errorEncoder->encode($error);
}
diff --git a/src/Implementation/Encoding/ErrorToPhpArrayEncoder.php b/src/Implementation/Encoding/ErrorToPhpArrayEncoder.php
index 5189e7e..91903e9 100644
--- a/src/Implementation/Encoding/ErrorToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/ErrorToPhpArrayEncoder.php
@@ -10,16 +10,14 @@
use Undabot\JsonApi\Definition\Encoding\SourceToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Error\ErrorInterface;
+/** @psalm-suppress UnusedClass */
class ErrorToPhpArrayEncoder implements ErrorToPhpArrayEncoderInterface
{
- /** @var LinkToPhpArrayEncoderInterface */
- private $linkEncoder;
+ private LinkToPhpArrayEncoderInterface $linkEncoder;
- /** @var SourceToPhpArrayEncoderInterface */
- private $sourceEncoder;
+ private SourceToPhpArrayEncoderInterface $sourceEncoder;
- /** @var MetaToPhpArrayEncoderInterface */
- private $metaEncoder;
+ private MetaToPhpArrayEncoderInterface $metaEncoder;
public function __construct(
LinkToPhpArrayEncoderInterface $linkEncoder,
@@ -31,40 +29,48 @@ public function __construct(
$this->metaEncoder = $metaEncoder;
}
+ /** @return array */
public function encode(ErrorInterface $error): array
{
$serializedError = [];
-
- if (null !== $error->getId()) {
- $serializedError['id'] = $error->getId();
+ $id = $error->getId();
+ if (null !== $id) {
+ $serializedError['id'] = $id;
}
- if (null !== $error->getAboutLink()) {
- $serializedError['links'] = $this->linkEncoder->encode($error->getAboutLink());
+ $aboutLink = $error->getAboutLink();
+ if (null !== $aboutLink) {
+ $serializedError['links'] = $this->linkEncoder->encode($aboutLink);
}
- if (null !== $error->getStatus()) {
- $serializedError['status'] = $error->getStatus();
+ $status = $error->getStatus();
+ if (null !== $status) {
+ $serializedError['status'] = $status;
}
- if (null !== $error->getCode()) {
- $serializedError['code'] = $error->getCode();
+ $code = $error->getCode();
+ if (null !== $code) {
+ $serializedError['code'] = $code;
}
- if (null !== $error->getTitle()) {
- $serializedError['title'] = $error->getTitle();
+ $title = $error->getTitle();
+ if (null !== $title) {
+ $serializedError['title'] = $title;
}
- if (null !== $error->getDetail()) {
- $serializedError['detail'] = $error->getDetail();
+ $detail = $error->getDetail();
+ if (null !== $detail) {
+ $serializedError['detail'] = $detail;
}
- if (null !== $error->getSource()) {
- $serializedError['source'] = $this->sourceEncoder->encode($error->getSource());
+ $source = $error->getSource();
+ if (null !== $source) {
+ $serializedError['source'] = $this->sourceEncoder->encode($source);
}
- if (null !== $error->getMeta()) {
- $serializedError['meta'] = $this->metaEncoder->encode($error->getMeta());
+ $meta = $error->getMeta();
+ if (null !== $meta) {
+ $serializedError['meta'] = $this->metaEncoder->encode($meta);
}
return $serializedError;
diff --git a/src/Implementation/Encoding/Exception/JsonApiEncodingException.php b/src/Implementation/Encoding/Exception/JsonApiEncodingException.php
index a3bbda6..32a9057 100644
--- a/src/Implementation/Encoding/Exception/JsonApiEncodingException.php
+++ b/src/Implementation/Encoding/Exception/JsonApiEncodingException.php
@@ -4,8 +4,4 @@
namespace Undabot\JsonApi\Implementation\Encoding\Exception;
-use Exception;
-
-class JsonApiEncodingException extends Exception
-{
-}
+class JsonApiEncodingException extends \Exception {}
diff --git a/src/Implementation/Encoding/LinkCollectionToPhpArrayEncoder.php b/src/Implementation/Encoding/LinkCollectionToPhpArrayEncoder.php
index 745b9c6..46648c5 100644
--- a/src/Implementation/Encoding/LinkCollectionToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/LinkCollectionToPhpArrayEncoder.php
@@ -7,23 +7,24 @@
use Undabot\JsonApi\Definition\Encoding\LinkCollectionToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Encoding\LinkToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Link\LinkCollectionInterface;
-use Undabot\JsonApi\Definition\Model\Link\LinkInterface;
+/** @psalm-suppress UnusedClass */
class LinkCollectionToPhpArrayEncoder implements LinkCollectionToPhpArrayEncoderInterface
{
- /** @var LinkToPhpArrayEncoderInterface */
- private $linkEncoder;
+ private LinkToPhpArrayEncoderInterface $linkEncoder;
public function __construct(LinkToPhpArrayEncoderInterface $linkEncoder)
{
$this->linkEncoder = $linkEncoder;
}
+ /**
+ * @return array
+ */
public function encode(LinkCollectionInterface $linkCollection): array
{
$links = [];
- /** @var LinkInterface $link */
foreach ($linkCollection as $link) {
$links[$link->getName()] = $this->linkEncoder->encode($link);
}
diff --git a/src/Implementation/Encoding/LinkToPhpArrayEncoder.php b/src/Implementation/Encoding/LinkToPhpArrayEncoder.php
index 254e09e..4206122 100644
--- a/src/Implementation/Encoding/LinkToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/LinkToPhpArrayEncoder.php
@@ -9,10 +9,10 @@
use Undabot\JsonApi\Implementation\Model\Link\LinkObject;
use Undabot\JsonApi\Implementation\Model\Link\LinkUrl;
+/** @psalm-suppress UnusedClass */
class LinkToPhpArrayEncoder implements LinkToPhpArrayEncoderInterface
{
- /** @var MetaToPhpArrayEncoder */
- private $metaToPhpArrayEncoder;
+ private MetaToPhpArrayEncoder $metaToPhpArrayEncoder;
public function __construct(MetaToPhpArrayEncoder $metaToPhpArrayEncoder)
{
@@ -20,7 +20,7 @@ public function __construct(MetaToPhpArrayEncoder $metaToPhpArrayEncoder)
}
/**
- * @return null|array|string
+ * @return null|array|string
*/
public function encode(LinkInterface $link)
{
@@ -40,6 +40,9 @@ public function encode(LinkInterface $link)
return null;
}
+ /**
+ * @return array
+ */
private function encodeLinkObject(LinkObject $linkObject): array
{
$serializedLinkObject = [];
diff --git a/src/Implementation/Encoding/MetaToPhpArrayEncoder.php b/src/Implementation/Encoding/MetaToPhpArrayEncoder.php
index 02d906e..0210f1f 100644
--- a/src/Implementation/Encoding/MetaToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/MetaToPhpArrayEncoder.php
@@ -9,6 +9,7 @@
class MetaToPhpArrayEncoder implements MetaToPhpArrayEncoderInterface
{
+ /** @return array */
public function encode(MetaInterface $meta): array
{
return $meta->getData();
diff --git a/src/Implementation/Encoding/PhpArrayToAttributeCollectionEncoder.php b/src/Implementation/Encoding/PhpArrayToAttributeCollectionEncoder.php
index a449b20..5ef9954 100644
--- a/src/Implementation/Encoding/PhpArrayToAttributeCollectionEncoder.php
+++ b/src/Implementation/Encoding/PhpArrayToAttributeCollectionEncoder.php
@@ -9,6 +9,7 @@
use Undabot\JsonApi\Implementation\Model\Resource\Attribute\Attribute;
use Undabot\JsonApi\Implementation\Model\Resource\Attribute\AttributeCollection;
+/** @psalm-api */
class PhpArrayToAttributeCollectionEncoder implements PhpArrayToAttributeCollectionEncoderInterface
{
public function encode(array $attributes): AttributeCollectionInterface
diff --git a/src/Implementation/Encoding/PhpArrayToLinkCollectionEncoder.php b/src/Implementation/Encoding/PhpArrayToLinkCollectionEncoder.php
index 2af4437..d7da4b2 100644
--- a/src/Implementation/Encoding/PhpArrayToLinkCollectionEncoder.php
+++ b/src/Implementation/Encoding/PhpArrayToLinkCollectionEncoder.php
@@ -8,14 +8,17 @@
use Undabot\JsonApi\Definition\Model\Link\LinkCollectionInterface;
use Undabot\JsonApi\Definition\Model\Link\LinkInterface;
+/** @psalm-suppress UnusedClass */
class PhpArrayToLinkCollectionEncoder implements PhpArrayToLinkCollectionEncoderInterface
{
+ /** @param array $links */
public function encode(array $links): LinkCollectionInterface
{
throw new \RuntimeException('Not implemented');
// @todo implement
}
+ /** @psalm-suppress PossiblyUnusedParam */
public function decodeLinkObject(string $name, string $url): LinkInterface
{
throw new \RuntimeException('Not implemented');
diff --git a/src/Implementation/Encoding/PhpArrayToMetaEncoder.php b/src/Implementation/Encoding/PhpArrayToMetaEncoder.php
index fe9d167..214176b 100644
--- a/src/Implementation/Encoding/PhpArrayToMetaEncoder.php
+++ b/src/Implementation/Encoding/PhpArrayToMetaEncoder.php
@@ -8,8 +8,10 @@
use Undabot\JsonApi\Definition\Model\Meta\MetaInterface;
use Undabot\JsonApi\Implementation\Model\Meta\Meta;
+/** @psalm-suppress UnusedClass */
class PhpArrayToMetaEncoder implements PhpArrayToMetaEncoderInterface
{
+ /** @param array $meta */
public function decode(array $meta): MetaInterface
{
return new Meta($meta);
diff --git a/src/Implementation/Encoding/PhpArrayToRelationshipCollectionEncoder.php b/src/Implementation/Encoding/PhpArrayToRelationshipCollectionEncoder.php
index fb11e97..d360c94 100644
--- a/src/Implementation/Encoding/PhpArrayToRelationshipCollectionEncoder.php
+++ b/src/Implementation/Encoding/PhpArrayToRelationshipCollectionEncoder.php
@@ -23,15 +23,17 @@
use Undabot\JsonApi\Util\ValidResourceIdentifierAssertion;
use Undabot\JsonApi\Util\ValidResourceLinkageAssertion;
+/** @psalm-suppress UnusedClass */
class PhpArrayToRelationshipCollectionEncoder implements PhpArrayToRelationshipCollectionEncoderInterface
{
public function __construct(
private PhpArrayToMetaEncoderInterface $phpArrayToMetaEncoder,
private PhpArrayToLinkCollectionEncoderInterface $phpArrayToLinkCollectionEncoder
- ) {
- }
+ ) {}
/**
+ * @param array> $relationships
+ *
* @throws JsonApiEncodingException
*/
public function encode(array $relationships): RelationshipCollectionInterface
@@ -48,17 +50,19 @@ public function encode(array $relationships): RelationshipCollectionInterface
}
/**
+ * @param array $relationshipValue
+ *
* @throws JsonApiEncodingException
*/
private function decodeRelationship(string $relationshipName, array $relationshipValue): Relationship
{
$relationshipData = null;
$relationshipMeta = null;
- if (true === \array_key_exists('data', $relationshipValue)) {
+ if (true === \array_key_exists('data', $relationshipValue) && \is_array($relationshipValue['data'])) {
$relationshipData = $this->parseRelationshipData($relationshipValue['data']);
if ($relationshipData instanceof ToOneRelationshipDataInterface) {
- $data = $relationshipValue['data'] ?? null;
- if (null !== $data && true === \array_key_exists('meta', $data)) {
+ $data = $relationshipValue['data'];
+ if (true === \array_key_exists('meta', $data)) {
$relationshipMeta = $this->phpArrayToMetaEncoder->decode($relationshipValue['data']['meta']);
}
} elseif ($relationshipData instanceof ToManyRelationshipDataInterface) {
@@ -74,7 +78,7 @@ private function decodeRelationship(string $relationshipName, array $relationshi
}
$relationshipLinks = null;
- if (true === \array_key_exists('links', $relationshipValue)) {
+ if (true === \array_key_exists('links', $relationshipValue) && \is_array($relationshipValue['links'])) {
$relationshipLinks = $this->phpArrayToLinkCollectionEncoder->encode($relationshipValue['links']);
}
@@ -87,6 +91,8 @@ private function decodeRelationship(string $relationshipName, array $relationshi
}
/**
+ * @param null|array|string> $resourceLinkage
+ *
* @throws JsonApiEncodingException
*/
private function parseRelationshipData(?array $resourceLinkage): RelationshipDataInterface
@@ -105,17 +111,20 @@ private function parseRelationshipData(?array $resourceLinkage): RelationshipDat
return ToOneRelationshipData::makeEmpty();
}
- if (true === \is_array($resourceLinkage) && 0 === \count($resourceLinkage)) {
+ if (0 === \count($resourceLinkage)) {
return ToManyRelationshipData::makeEmpty();
}
$isAssociativeArray = ArrayUtil::isMap($resourceLinkage);
if (false === $isAssociativeArray) {
+ /** @var array> $resourceLinkage */
$identifiersCollection = $this->parseResourceIdentifierCollection($resourceLinkage);
return ToManyRelationshipData::make($identifiersCollection);
}
+ // at this point we have not null to one relationship
+ /** @var array{id: string, type: string, meta?: array} $resourceLinkage */
$resourceIdentifier = new ResourceIdentifier(
$resourceLinkage['id'],
$resourceLinkage['type'],
@@ -125,10 +134,12 @@ private function parseRelationshipData(?array $resourceLinkage): RelationshipDat
return ToOneRelationshipData::make($resourceIdentifier);
}
+ /** @param array> $data */
private function parseResourceIdentifierCollection(array $data): ResourceIdentifierCollection
{
$resourceIdentifiers = [];
+ /** @var array{id: string, type: string, meta?: array} $datum */
foreach ($data as $datum) {
ValidResourceIdentifierAssertion::assert($datum);
$resourceIdentifiers[] = new ResourceIdentifier(
diff --git a/src/Implementation/Encoding/PhpArrayToResourceEncoder.php b/src/Implementation/Encoding/PhpArrayToResourceEncoder.php
index bc56584..0d79724 100644
--- a/src/Implementation/Encoding/PhpArrayToResourceEncoder.php
+++ b/src/Implementation/Encoding/PhpArrayToResourceEncoder.php
@@ -12,19 +12,18 @@
use Undabot\JsonApi\Definition\Model\Resource\ResourceInterface;
use Undabot\JsonApi\Implementation\Encoding\Exception\JsonApiEncodingException;
use Undabot\JsonApi\Implementation\Model\Resource\Resource;
+use Undabot\JsonApi\Util\ArrayUtil;
use Undabot\JsonApi\Util\Exception\ValidationException;
use Undabot\JsonApi\Util\ValidResourceAssertion;
+/** @psalm-api */
class PhpArrayToResourceEncoder implements PhpArrayToResourceEncoderInterface
{
- /** @var PhpArrayToRelationshipCollectionEncoderInterface */
- private $phpArrayToRelationshipCollectionEncoder;
+ private PhpArrayToRelationshipCollectionEncoderInterface $phpArrayToRelationshipCollectionEncoder;
- /** @var PhpArrayToAttributeCollectionEncoderInterface */
- private $phpArrayToAttributeCollectionEncoder;
+ private PhpArrayToAttributeCollectionEncoderInterface $phpArrayToAttributeCollectionEncoder;
- /** @var PhpArrayToMetaEncoderInterface */
- private $phpArrayToMetaEncoder;
+ private PhpArrayToMetaEncoderInterface $phpArrayToMetaEncoder;
public function __construct(
PhpArrayToRelationshipCollectionEncoderInterface $phpArrayToRelationshipCollectionEncoder,
@@ -51,17 +50,21 @@ public function decode(array $resource): ResourceInterface
);
}
- $rawRelationships = $resource['relationships'] ?? [];
- $rawAttributes = $resource['attributes'] ?? [];
- $rawMeta = $resource['meta'] ?? null;
- $rawLink = $resource['links']['self'] ?? null;
+ $rawAttributes = ArrayUtil::assertStringKeyArray($resource, 'attributes');
+ $rawMeta = ArrayUtil::assertStringKeyArray($resource, 'meta');
+ $rawLink = \is_array($resource['links'] ?? null) ? ($resource['links']['self'] ?? null) : null;
+ $rawRelationships = ArrayUtil::assertStringKeyArrayNested($resource, 'relationships');
+
if (null !== $rawLink) {
throw new \RuntimeException('Not implemented');
}
+ $id = \is_string($resource['id']) ? $resource['id'] : throw new \InvalidArgumentException("Expected a string for 'id'");
+ $type = \is_string($resource['type']) ? $resource['type'] : throw new \InvalidArgumentException("Expected a string for 'type'");
+
return new Resource(
- $resource['id'],
- $resource['type'],
+ $id,
+ $type,
$this->phpArrayToAttributeCollectionEncoder->encode($rawAttributes),
$this->phpArrayToRelationshipCollectionEncoder->encode($rawRelationships),
null,
@@ -69,6 +72,9 @@ public function decode(array $resource): ResourceInterface
);
}
+ /**
+ * @param null|array $rawMeta
+ */
private function parseMeta(?array $rawMeta): ?MetaInterface
{
if (null === $rawMeta) {
diff --git a/src/Implementation/Encoding/RelationshipCollectionToPhpArrayEncoder.php b/src/Implementation/Encoding/RelationshipCollectionToPhpArrayEncoder.php
index 5f53a03..fb1ac7b 100644
--- a/src/Implementation/Encoding/RelationshipCollectionToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/RelationshipCollectionToPhpArrayEncoder.php
@@ -7,27 +7,28 @@
use Undabot\JsonApi\Definition\Encoding\RelationshipCollectionToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Encoding\RelationshipToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\RelationshipCollectionInterface;
-use Undabot\JsonApi\Definition\Model\Resource\Relationship\RelationshipInterface;
+/** @psalm-suppress UnusedClass */
class RelationshipCollectionToPhpArrayEncoder implements RelationshipCollectionToPhpArrayEncoderInterface
{
- /** @var RelationshipToPhpArrayEncoderInterface */
- private $relationshipToPhpArrayEncoder;
+ private RelationshipToPhpArrayEncoderInterface $relationshipToPhpArrayEncoder;
public function __construct(RelationshipToPhpArrayEncoderInterface $relationshipToPhpArrayEncoder)
{
$this->relationshipToPhpArrayEncoder = $relationshipToPhpArrayEncoder;
}
- public function encode(RelationshipCollectionInterface $relationshipCollection): array
+ /**
+ * @return array
+ */
+ public function encode(RelationshipCollectionInterface $relationships): array
{
- $relationships = [];
+ $relationshipsArray = [];
- /** @var RelationshipInterface $relationship */
- foreach ($relationshipCollection as $relationship) {
- $relationships[$relationship->getName()] = $this->relationshipToPhpArrayEncoder->encode($relationship);
+ foreach ($relationships as $relationship) {
+ $relationshipsArray[$relationship->getName()] = $this->relationshipToPhpArrayEncoder->encode($relationship);
}
- return $relationships;
+ return $relationshipsArray;
}
}
diff --git a/src/Implementation/Encoding/RelationshipToPhpArrayEncoder.php b/src/Implementation/Encoding/RelationshipToPhpArrayEncoder.php
index 87fe1da..5e87342 100644
--- a/src/Implementation/Encoding/RelationshipToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/RelationshipToPhpArrayEncoder.php
@@ -4,7 +4,6 @@
namespace Undabot\JsonApi\Implementation\Encoding;
-use DomainException;
use Undabot\JsonApi\Definition\Encoding\LinkCollectionToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Encoding\MetaToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Encoding\RelationshipToPhpArrayEncoderInterface;
@@ -12,18 +11,15 @@
use Undabot\JsonApi\Definition\Model\Resource\Relationship\Data\ToManyRelationshipDataInterface;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\Data\ToOneRelationshipDataInterface;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\RelationshipInterface;
-use Undabot\JsonApi\Definition\Model\Resource\ResourceIdentifierInterface;
+/** @psalm-suppress UnusedClass */
class RelationshipToPhpArrayEncoder implements RelationshipToPhpArrayEncoderInterface
{
- /** @var MetaToPhpArrayEncoderInterface */
- private $metaToPhpArrayEncoder;
+ private MetaToPhpArrayEncoderInterface $metaToPhpArrayEncoder;
- /** @var LinkCollectionToPhpArrayEncoderInterface */
- private $linkCollectionToPhpArrayEncoder;
+ private LinkCollectionToPhpArrayEncoderInterface $linkCollectionToPhpArrayEncoder;
- /** @var ResourceIdentifierToPhpArrayEncoder */
- private $resourceIdentifierToPhpArrayEncoder;
+ private ResourceIdentifierToPhpArrayEncoder $resourceIdentifierToPhpArrayEncoder;
public function __construct(
MetaToPhpArrayEncoderInterface $metaToPhpArrayEncoder,
@@ -35,25 +31,32 @@ public function __construct(
$this->resourceIdentifierToPhpArrayEncoder = $resourceIdentifierToPhpArrayEncoder;
}
+ /**
+ * @return array
+ */
public function encode(RelationshipInterface $relationship): array
{
$serializedRelationship = [];
-
- if (null !== $relationship->getMeta()) {
- $serializedRelationship['meta'] = $this->metaToPhpArrayEncoder->encode($relationship->getMeta());
+ $meta = $relationship->getMeta();
+ if (null !== $meta) {
+ $serializedRelationship['meta'] = $this->metaToPhpArrayEncoder->encode($meta);
}
- if (null !== $relationship->getLinks()) {
- $serializedRelationship['links'] = $this->linkCollectionToPhpArrayEncoder->encode($relationship->getLinks());
+ $links = $relationship->getLinks();
+ if (null !== $links) {
+ $serializedRelationship['links'] = $this->linkCollectionToPhpArrayEncoder->encode($links);
}
-
- if (null !== $relationship->getData()) {
- $serializedRelationship['data'] = $this->encodeRelationshipData($relationship->getData());
+ $data = $relationship->getData();
+ if (null !== $data) {
+ $serializedRelationship['data'] = $this->encodeRelationshipData($data);
}
return $serializedRelationship;
}
+ /**
+ * @return null|array
+ */
private function encodeRelationshipData(?RelationshipDataInterface $data): ?array
{
if ($data instanceof ToOneRelationshipDataInterface) {
@@ -65,19 +68,26 @@ private function encodeRelationshipData(?RelationshipDataInterface $data): ?arra
}
// @todo this is not a domain exception, but rather UI...
- throw new DomainException('Invalid relationship data');
+ throw new \DomainException('Invalid relationship data');
}
- private function encodeToOneRelationshipData(ToOneRelationshipDataInterface $data)
+ /**
+ * @return null|array
+ */
+ private function encodeToOneRelationshipData(ToOneRelationshipDataInterface $data): ?array
{
- if (null === $data->getData()) {
+ $data = $data->getData();
+ if (null === $data) {
return null;
}
- return $this->resourceIdentifierToPhpArrayEncoder->encode($data->getData());
+ return $this->resourceIdentifierToPhpArrayEncoder->encode($data);
}
- private function encodeToManyRelationshipData(ToManyRelationshipDataInterface $data)
+ /**
+ * @return array>
+ */
+ private function encodeToManyRelationshipData(ToManyRelationshipDataInterface $data): array
{
if ($data->isEmpty()) {
return [];
@@ -85,7 +95,6 @@ private function encodeToManyRelationshipData(ToManyRelationshipDataInterface $d
$serializedData = [];
- /** @var ResourceIdentifierInterface $resourceIdentifier */
foreach ($data->getData() as $resourceIdentifier) {
$serializedData[] = $this->resourceIdentifierToPhpArrayEncoder->encode($resourceIdentifier);
}
diff --git a/src/Implementation/Encoding/ResourceCollectionToPhpArrayEncoder.php b/src/Implementation/Encoding/ResourceCollectionToPhpArrayEncoder.php
index 589f216..c97d1bf 100644
--- a/src/Implementation/Encoding/ResourceCollectionToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/ResourceCollectionToPhpArrayEncoder.php
@@ -8,24 +8,25 @@
use Undabot\JsonApi\Definition\Encoding\ResourceToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceCollectionInterface;
+/** @psalm-suppress UnusedClass */
class ResourceCollectionToPhpArrayEncoder implements ResourceCollectionToPhpArrayEncoderInterface
{
- /** @var ResourceToPhpArrayEncoderInterface */
- private $resourceToPhpArrayEncoder;
+ private ResourceToPhpArrayEncoderInterface $resourceToPhpArrayEncoder;
public function __construct(ResourceToPhpArrayEncoderInterface $resourceToPhpArrayEncoder)
{
$this->resourceToPhpArrayEncoder = $resourceToPhpArrayEncoder;
}
- public function encode(ResourceCollectionInterface $resourceCollection): array
+ /** @return array> */
+ public function encode(ResourceCollectionInterface $resources): array
{
- $resources = [];
+ $resourcesArray = [];
- foreach ($resourceCollection as $resource) {
- $resources[] = $this->resourceToPhpArrayEncoder->encode($resource);
+ foreach ($resources as $resource) {
+ $resourcesArray[] = $this->resourceToPhpArrayEncoder->encode($resource);
}
- return $resources;
+ return $resourcesArray;
}
}
diff --git a/src/Implementation/Encoding/ResourceIdentifierCollectionToPhpArrayEncoder.php b/src/Implementation/Encoding/ResourceIdentifierCollectionToPhpArrayEncoder.php
index d1adc20..4082da6 100644
--- a/src/Implementation/Encoding/ResourceIdentifierCollectionToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/ResourceIdentifierCollectionToPhpArrayEncoder.php
@@ -8,16 +8,19 @@
use Undabot\JsonApi\Definition\Encoding\ResourceIdentifierToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceIdentifierCollectionInterface;
+/** @psalm-suppress UnusedClass */
class ResourceIdentifierCollectionToPhpArrayEncoder implements ResourceIdentifierCollectionToPhpArrayEncoderInterface
{
/** @var ResourceIdentifierToPhpArrayEncoderInterface */
private $resourceIdentifierToPhpArrayEncoder;
+ /** @psalm-suppress PossiblyUnusedMethod */
public function __construct(ResourceIdentifierToPhpArrayEncoderInterface $resourceIdentifierToPhpArrayEncoder)
{
$this->resourceIdentifierToPhpArrayEncoder = $resourceIdentifierToPhpArrayEncoder;
}
+ /** @return array> */
public function encode(ResourceIdentifierCollectionInterface $resourceIdentifierCollection): array
{
$resourceIdentifiers = [];
diff --git a/src/Implementation/Encoding/ResourceIdentifierToPhpArrayEncoder.php b/src/Implementation/Encoding/ResourceIdentifierToPhpArrayEncoder.php
index 48fff3e..ea9fbc1 100644
--- a/src/Implementation/Encoding/ResourceIdentifierToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/ResourceIdentifierToPhpArrayEncoder.php
@@ -8,25 +8,29 @@
use Undabot\JsonApi\Definition\Encoding\ResourceIdentifierToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceIdentifierInterface;
+/** @psalm-suppress UnusedClass */
class ResourceIdentifierToPhpArrayEncoder implements ResourceIdentifierToPhpArrayEncoderInterface
{
/** @var MetaToPhpArrayEncoderInterface */
private $metaToPhpArrayEncoder;
+ /** @psalm-suppress PossiblyUnusedMethod */
public function __construct(MetaToPhpArrayEncoderInterface $metaToPhpArrayEncoder)
{
$this->metaToPhpArrayEncoder = $metaToPhpArrayEncoder;
}
- public function encode(ResourceIdentifierInterface $resourceIdentifier)
+ /** @return array */
+ public function encode(ResourceIdentifierInterface $resourceIdentifier): array
{
$serializedResourceIdentifier = [
'type' => $resourceIdentifier->getType(),
'id' => $resourceIdentifier->getId(),
];
- if (null !== $resourceIdentifier->getMeta()) {
- $serializedResourceIdentifier['meta'] = $this->metaToPhpArrayEncoder->encode($resourceIdentifier->getMeta());
+ $resourceIdentifier = $resourceIdentifier->getMeta();
+ if (null !== $resourceIdentifier) {
+ $serializedResourceIdentifier['meta'] = $this->metaToPhpArrayEncoder->encode($resourceIdentifier);
}
return $serializedResourceIdentifier;
diff --git a/src/Implementation/Encoding/ResourceToPhpArrayEncoder.php b/src/Implementation/Encoding/ResourceToPhpArrayEncoder.php
index aaf0e9f..0f52ddc 100644
--- a/src/Implementation/Encoding/ResourceToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/ResourceToPhpArrayEncoder.php
@@ -11,6 +11,7 @@
use Undabot\JsonApi\Definition\Encoding\ResourceToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceInterface;
+/** @psalm-suppress UnusedClass */
class ResourceToPhpArrayEncoder implements ResourceToPhpArrayEncoderInterface
{
/** @var MetaToPhpArrayEncoderInterface */
@@ -22,8 +23,7 @@ class ResourceToPhpArrayEncoder implements ResourceToPhpArrayEncoderInterface
/** @var LinkToPhpArrayEncoderInterface */
private $linkEncoder;
- /** @var AttributeCollectionToPhpArrayEncoderInterface */
- private $attributeCollectionEncoder;
+ private AttributeCollectionToPhpArrayEncoderInterface $attributeCollectionEncoder;
public function __construct(
MetaToPhpArrayEncoderInterface $metaEncoder,
@@ -37,6 +37,7 @@ public function __construct(
$this->attributeCollectionEncoder = $attributeCollectionEncoder;
}
+ /** @return array */
public function encode(ResourceInterface $resource): array
{
$serializedResource = [
@@ -44,22 +45,26 @@ public function encode(ResourceInterface $resource): array
'id' => $resource->getId(),
];
- if (null !== $resource->getAttributes()) {
- $serializedResource['attributes'] = $this->attributeCollectionEncoder->encode($resource->getAttributes());
+ $attributes = $resource->getAttributes();
+ if (null !== $attributes) {
+ $serializedResource['attributes'] = $this->attributeCollectionEncoder->encode($attributes);
}
- if (null !== $resource->getMeta()) {
- $serializedResource['meta'] = $this->metaEncoder->encode($resource->getMeta());
+ $meta = $resource->getMeta();
+ if (null !== $meta) {
+ $serializedResource['meta'] = $this->metaEncoder->encode($meta);
}
- if (null !== $resource->getSelfUrl()) {
+ $selfUrl = $resource->getSelfUrl();
+ if (null !== $selfUrl) {
$serializedResource['links'] = [
- 'self' => $this->linkEncoder->encode($resource->getSelfUrl()),
+ 'self' => $this->linkEncoder->encode($selfUrl),
];
}
- if (null !== $resource->getRelationships()) {
- $encodedRelationships = $this->relationshipCollectionEncoder->encode($resource->getRelationships());
+ $relationships = $resource->getRelationships();
+ if (null !== $relationships) {
+ $encodedRelationships = $this->relationshipCollectionEncoder->encode($relationships);
// relationships key must be object
// if it's empty, we'll get empty array and it will be encoded to array
// so in that case we'll create php object so json encode will return object
diff --git a/src/Implementation/Encoding/SourceToPhpArrayEncoder.php b/src/Implementation/Encoding/SourceToPhpArrayEncoder.php
index 190c8d8..b367f2f 100644
--- a/src/Implementation/Encoding/SourceToPhpArrayEncoder.php
+++ b/src/Implementation/Encoding/SourceToPhpArrayEncoder.php
@@ -7,8 +7,12 @@
use Undabot\JsonApi\Definition\Encoding\SourceToPhpArrayEncoderInterface;
use Undabot\JsonApi\Definition\Model\Source\SourceInterface;
+/** @psalm-suppress UnusedClass */
class SourceToPhpArrayEncoder implements SourceToPhpArrayEncoderInterface
{
+ /**
+ * @return array
+ */
public function encode(SourceInterface $source): array
{
$serializedSource = [];
diff --git a/src/Implementation/Factory/PaginationFactory.php b/src/Implementation/Factory/PaginationFactory.php
index f3530fe..3c78e3e 100644
--- a/src/Implementation/Factory/PaginationFactory.php
+++ b/src/Implementation/Factory/PaginationFactory.php
@@ -5,17 +5,18 @@
namespace Undabot\JsonApi\Implementation\Factory;
use Assert\Assertion;
-use InvalidArgumentException;
+use Assert\AssertionFailedException;
use Undabot\JsonApi\Definition\Model\Request\Pagination\PaginationInterface;
use Undabot\JsonApi\Implementation\Model\Request\Pagination\OffsetBasedPagination;
use Undabot\JsonApi\Implementation\Model\Request\Pagination\PageBasedPagination;
+/** @psalm-suppress UnusedClass */
class PaginationFactory
{
/**
* @param array $paginationParams
*
- * @throws \Assert\AssertionFailedException
+ * @throws AssertionFailedException
*/
public function fromArray(array $paginationParams): PaginationInterface
{
@@ -31,13 +32,13 @@ public function fromArray(array $paginationParams): PaginationInterface
$message = sprintf('Couldn\'t create pagination from given params: %s', json_encode($paginationParams));
- throw new InvalidArgumentException($message);
+ throw new \InvalidArgumentException($message);
}
/**
- * @param array $paginationParams
+ * @param array $paginationParams
*
- * @throws \Assert\AssertionFailedException
+ * @throws AssertionFailedException
*/
private function makePageBasedPagination(array $paginationParams): PageBasedPagination
{
@@ -72,9 +73,9 @@ private function makePageBasedPagination(array $paginationParams): PageBasedPagi
}
/**
- * @param array $paginationParams
+ * @param array $paginationParams
*
- * @throws \Assert\AssertionFailedException
+ * @throws AssertionFailedException
*/
private function makeOffsetBasedPagination(array $paginationParams): OffsetBasedPagination
{
diff --git a/src/Implementation/Factory/RelationshipDataFactory.php b/src/Implementation/Factory/RelationshipDataFactory.php
index ab5ed22..f40d613 100644
--- a/src/Implementation/Factory/RelationshipDataFactory.php
+++ b/src/Implementation/Factory/RelationshipDataFactory.php
@@ -5,16 +5,26 @@
namespace Undabot\JsonApi\Implementation\Factory;
use Assert\Assertion;
+use Assert\AssertionFailedException;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\Data\RelationshipDataInterface;
use Undabot\JsonApi\Implementation\Model\Resource\Relationship\Data\ToManyRelationshipData;
use Undabot\JsonApi\Implementation\Model\Resource\Relationship\Data\ToOneRelationshipData;
use Undabot\JsonApi\Implementation\Model\Resource\ResourceIdentifier;
use Undabot\JsonApi\Implementation\Model\Resource\ResourceIdentifierCollection;
+/** @psalm-suppress UnusedClass */
class RelationshipDataFactory
{
- public function make(string $type, bool $toMany, $data): ?RelationshipDataInterface
- {
+ /**
+ * @param null|string|string[] $data
+ *
+ * @throws AssertionFailedException
+ */
+ public function make(
+ string $type,
+ bool $toMany,
+ null|array|string $data
+ ): ?RelationshipDataInterface {
if (null === $data && true === $toMany) {
return ToManyRelationshipData::makeEmpty();
}
@@ -40,12 +50,10 @@ public function make(string $type, bool $toMany, $data): ?RelationshipDataInterf
);
}
- if (false === $toMany) {
- Assertion::string($data);
+ Assertion::string($data);
- return ToOneRelationshipData::make(
- new ResourceIdentifier($data, $type)
- );
- }
+ return ToOneRelationshipData::make(
+ new ResourceIdentifier($data, $type)
+ );
}
}
diff --git a/src/Implementation/Model/Document/Document.php b/src/Implementation/Model/Document/Document.php
index bda14e2..058d52e 100644
--- a/src/Implementation/Model/Document/Document.php
+++ b/src/Implementation/Model/Document/Document.php
@@ -4,7 +4,6 @@
namespace Undabot\JsonApi\Implementation\Model\Document;
-use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Document\DocumentDataInterface;
use Undabot\JsonApi\Definition\Model\Document\DocumentInterface;
use Undabot\JsonApi\Definition\Model\Error\ErrorCollectionInterface;
@@ -14,25 +13,20 @@
use Undabot\JsonApi\Definition\Model\Resource\ResourceCollectionInterface;
use Undabot\JsonApi\Implementation\Model\Link\Link;
+/** @psalm-suppress UnusedClass */
class Document implements DocumentInterface
{
- /** @var null|DocumentDataInterface */
- private $data;
+ private ?DocumentDataInterface $data;
- /** @var null|ErrorCollectionInterface */
- private $errors;
+ private ?ErrorCollectionInterface $errors;
- /** @var null|MetaInterface */
- private $meta;
+ private ?MetaInterface $meta;
- /** @var null|MetaInterface */
- private $jsonApiMeta;
+ private ?MetaInterface $jsonApiMeta;
- /** @var null|LinkCollectionInterface */
- private $links;
+ private ?LinkCollectionInterface $links;
- /** @var null|ResourceCollectionInterface */
- private $included;
+ private ?ResourceCollectionInterface $included;
public function __construct(
?DocumentDataInterface $data,
@@ -96,7 +90,7 @@ private function makeSureDataAndErrorsDontCoexist(
$hasErrors = null !== $errors;
if (true === $hasData && true === $hasErrors) {
- throw new InvalidArgumentException('The members data and errors MUST NOT coexist in the same document.');
+ throw new \InvalidArgumentException('The members data and errors MUST NOT coexist in the same document.');
}
}
@@ -124,7 +118,7 @@ private function makeSureOnlyValidLinksArePresent(?LinkCollectionInterface $link
/** @var Link $link */
foreach ($links as $link) {
if (false === \in_array($link->getName(), $validNames, true)) {
- throw new InvalidArgumentException("{$link->getName()} is not acceptable link");
+ throw new \InvalidArgumentException("{$link->getName()} is not acceptable link");
}
}
}
@@ -142,7 +136,7 @@ private function makeSureAtLeastOneIsPresent(
if (null === $errors
&& null === $data
&& null === $meta) {
- throw new InvalidArgumentException('A document MUST contain at least one of the following top-level members: data, errors, meta');
+ throw new \InvalidArgumentException('A document MUST contain at least one of the following top-level members: data, errors, meta');
}
}
@@ -154,7 +148,7 @@ private function makeSureIncludedIsNotPresentWithoutData(
?ResourceCollectionInterface $included
): void {
if (null === $data && null !== $included) {
- throw new InvalidArgumentException('a document does not contain a top-level data key, the included member MUST NOT be present either.');
+ throw new \InvalidArgumentException('a document does not contain a top-level data key, the included member MUST NOT be present either.');
}
}
}
diff --git a/src/Implementation/Model/Document/DocumentData.php b/src/Implementation/Model/Document/DocumentData.php
index 7e3e8e0..e345e87 100644
--- a/src/Implementation/Model/Document/DocumentData.php
+++ b/src/Implementation/Model/Document/DocumentData.php
@@ -4,22 +4,18 @@
namespace Undabot\JsonApi\Implementation\Model\Document;
-use DomainException;
-use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Document\DocumentDataInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceCollectionInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceIdentifierCollectionInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceIdentifierInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceInterface;
-use Undabot\JsonApi\Implementation\Model\Resource\ResourceCollection;
-use Undabot\JsonApi\Implementation\Model\Resource\ResourceIdentifierCollection;
+/** @psalm-suppress UnusedClass */
class DocumentData implements DocumentDataInterface
{
- /** @var null|ResourceCollection|ResourceIdentifierCollection|ResourceIdentifierInterface|ResourceInterface */
- private $data;
+ private mixed $data;
- public function __construct($data)
+ public function __construct(mixed $data)
{
$this->makeSureDataIsValid($data);
$this->data = $data;
@@ -52,25 +48,46 @@ public function isEmpty(): bool
public function getResource(): ResourceInterface
{
- return $this->returnDataIfTrue($this->isResource(), 'Data is not Resource');
+ $data = $this->data;
+ if (true !== $this->isResource()) {
+ throw new \DomainException('Data is not Resource');
+ }
+ /** @var ResourceInterface $data */
+
+ return $data;
}
public function getResourceCollection(): ResourceCollectionInterface
{
- return $this->returnDataIfTrue($this->isResourceCollection(), 'Data is not Resource Collection');
+ $data = $this->data;
+ if (true !== $this->isResourceCollection()) {
+ throw new \DomainException('Data is not Resource Collection');
+ }
+ /** @var ResourceCollectionInterface $data */
+
+ return $data;
}
public function getResourceIdentifier(): ResourceIdentifierInterface
{
- return $this->returnDataIfTrue($this->isResourceIdentifier(), 'Data is not Resource Identifier');
+ $data = $this->data;
+ if (true !== $this->isResourceIdentifier()) {
+ throw new \DomainException('Data is not Resource Identifier');
+ }
+ /** @var ResourceIdentifierInterface $data */
+
+ return $data;
}
public function getResourceIdentifierCollection(): ResourceIdentifierCollectionInterface
{
- return $this->returnDataIfTrue(
- $this->isResourceIdentifierCollection(),
- 'Data is not Resource Identifier Collection'
- );
+ $data = $this->data;
+ if (true !== $this->isResourceIdentifierCollection()) {
+ throw new \DomainException('Data is not Resource Identifier Collection');
+ }
+ /** @var ResourceIdentifierCollectionInterface $data */
+
+ return $data;
}
/**
@@ -112,15 +129,6 @@ private function makeSureDataIsValid($data): void
return;
}
- throw new InvalidArgumentException('Invalid data provided');
- }
-
- private function returnDataIfTrue(bool $condition, string $errorMessage)
- {
- if (true !== $condition) {
- throw new DomainException($errorMessage);
- }
-
- return $this->data;
+ throw new \InvalidArgumentException('Invalid data provided');
}
}
diff --git a/src/Implementation/Model/Error/Error.php b/src/Implementation/Model/Error/Error.php
index d55a3af..af008d3 100644
--- a/src/Implementation/Model/Error/Error.php
+++ b/src/Implementation/Model/Error/Error.php
@@ -4,49 +4,39 @@
namespace Undabot\JsonApi\Implementation\Model\Error;
-use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Error\ErrorInterface;
use Undabot\JsonApi\Definition\Model\Link\LinkInterface;
use Undabot\JsonApi\Definition\Model\Meta\MetaInterface;
use Undabot\JsonApi\Definition\Model\Source\SourceInterface;
+/** @psalm-suppress UnusedClass */
final class Error implements ErrorInterface
{
- /** @var string */
- private $id;
+ private ?string $id;
- /** @var LinkInterface */
- private $aboutLink;
+ private ?LinkInterface $aboutLink;
/**
* the HTTP status code applicable to this problem, expressed as a string value.
- *
- * @var null|string
*/
- private $status;
+ private ?string $status;
/**
* an application-specific error code, expressed as a string value.
- *
- * @var null|string
*/
- private $code;
+ private ?string $code;
/**
* a short, human-readable summary of the problem that SHOULD NOT change from occurrence to
* occurrence of the problem, except for purposes of localization.
- *
- * @var null|string
*/
- private $title;
+ private ?string $title;
/**
* detail: a human-readable explanation specific to this occurrence of the problem.
* Like title, this field’s value can be localized.
- *
- * @var null|string
*/
- private $detail;
+ private ?string $detail;
/**
* an object containing references to the source of the error.
@@ -57,10 +47,8 @@ final class Error implements ErrorInterface
/**
* an object containing references to the source of the error.
- *
- * @var null|MetaInterface
*/
- private $meta;
+ private ?MetaInterface $meta;
public function __construct(
?string $id,
@@ -72,38 +60,21 @@ public function __construct(
?SourceInterface $source = null,
?MetaInterface $meta = null
) {
- if (null !== $aboutLink) {
- $this->makeSureAboutLinkIsNamedAbout($aboutLink);
- $this->aboutLink = $aboutLink;
- }
-
- if (null !== $id) {
- $this->id = $id;
- }
+ $this->makeSureAboutLinkIsNamedAbout($aboutLink);
+ $this->aboutLink = $aboutLink;
- if (null !== $status) {
- $this->status = $status;
- }
+ $this->id = $id;
+ $this->status = $status;
- if (null !== $code) {
- $this->code = $code;
- }
+ $this->code = $code;
- if (null !== $title) {
- $this->title = $title;
- }
+ $this->title = $title;
- if (null !== $detail) {
- $this->detail = $detail;
- }
+ $this->detail = $detail;
- if (null !== $source) {
- $this->source = $source;
- }
+ $this->source = $source;
- if (null !== $meta) {
- $this->meta = $meta;
- }
+ $this->meta = $meta;
}
public function getId(): ?string
@@ -153,10 +124,10 @@ public function getMeta(): ?MetaInterface
* links: a links object containing the following members:
* - about: a link that leads to further details about this particular occurrence of the problem.
*/
- private function makeSureAboutLinkIsNamedAbout(LinkInterface $link): void
+ private function makeSureAboutLinkIsNamedAbout(?LinkInterface $link): void
{
- if ('about' !== $link->getName()) {
- throw new InvalidArgumentException('Error links only should have about member');
+ if (null !== $link && 'about' !== $link->getName()) {
+ throw new \InvalidArgumentException('Error links only should have about member');
}
}
}
diff --git a/src/Implementation/Model/Error/ErrorCollection.php b/src/Implementation/Model/Error/ErrorCollection.php
index ebb41a0..12fa206 100644
--- a/src/Implementation/Model/Error/ErrorCollection.php
+++ b/src/Implementation/Model/Error/ErrorCollection.php
@@ -4,40 +4,44 @@
namespace Undabot\JsonApi\Implementation\Model\Error;
-use ArrayIterator;
+use Assert\Assertion;
+use Assert\AssertionFailedException;
use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Error\ErrorCollectionInterface;
use Undabot\JsonApi\Definition\Model\Error\ErrorInterface;
+/** @psalm-suppress UnusedClass */
final class ErrorCollection implements ErrorCollectionInterface
{
- /** @var Error[] */
+ /** @var ErrorInterface[] */
private $errors;
+ /** @param ErrorInterface[] $errors */
public function __construct(array $errors)
{
- $this->makeSureAllErrorsAreValid($errors);
+ try {
+ Assertion::allIsInstanceOf($errors, ErrorInterface::class);
+ } catch (AssertionFailedException $exception) {
+ // $message = sprintf('ResourceIdentifierInterface expected, %s given', \get_class($resourceIdentifier));
+ //
+ // throw new InvalidArgumentException($message);
+ }
$this->errors = $errors;
}
+ /**
+ * @return ErrorInterface[]
+ */
public function getErrors(): array
{
return $this->errors;
}
- public function getIterator()
- {
- return new ArrayIterator($this->getErrors());
- }
-
- private function makeSureAllErrorsAreValid(array $errors): void
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- foreach ($errors as $error) {
- if (false === ($error instanceof ErrorInterface)) {
- $message = sprintf('Error expected, %s given', \get_class($error));
-
- throw new InvalidArgumentException($message);
- }
- }
+ return new \ArrayIterator($this->getErrors());
}
}
diff --git a/src/Implementation/Model/Link/Link.php b/src/Implementation/Model/Link/Link.php
index 07484c1..acc3657 100644
--- a/src/Implementation/Model/Link/Link.php
+++ b/src/Implementation/Model/Link/Link.php
@@ -4,7 +4,6 @@
namespace Undabot\JsonApi\Implementation\Model\Link;
-use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Link\LinkInterface;
use Undabot\JsonApi\Definition\Model\Link\LinkMemberInterface;
use Undabot\JsonApi\Definition\Model\Link\LinkNamesEnum;
@@ -17,6 +16,9 @@ final class Link implements LinkInterface
/** @var LinkMemberInterface */
private $link;
+ /**
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public function __construct(string $name, LinkMemberInterface $link)
{
$this->makeSureNameIsValid($name);
@@ -34,6 +36,9 @@ public function getLink(): ?LinkMemberInterface
return $this->link;
}
+ /**
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public function isLinkUrl(): bool
{
return $this->link instanceof LinkUrl;
@@ -42,7 +47,7 @@ public function isLinkUrl(): bool
private function makeSureNameIsValid(string $name): void
{
if (false === \in_array($name, LinkNamesEnum::getValues(), true)) {
- throw new InvalidArgumentException("Invalid link name {$name}");
+ throw new \InvalidArgumentException("Invalid link name {$name}");
}
}
}
diff --git a/src/Implementation/Model/Link/LinkCollection.php b/src/Implementation/Model/Link/LinkCollection.php
index c15b012..f6bef66 100644
--- a/src/Implementation/Model/Link/LinkCollection.php
+++ b/src/Implementation/Model/Link/LinkCollection.php
@@ -4,22 +4,26 @@
namespace Undabot\JsonApi\Implementation\Model\Link;
-use ArrayIterator;
use Assert\Assertion;
use Undabot\JsonApi\Definition\Model\Link\LinkCollectionInterface;
use Undabot\JsonApi\Definition\Model\Link\LinkInterface;
+/**
+ * @psalm-suppress UnusedClass
+ */
final class LinkCollection implements LinkCollectionInterface
{
/** @var LinkInterface[] */
- private $links;
+ private array $links;
+ /** @param LinkInterface[] $links */
public function __construct(array $links)
{
Assertion::allIsInstanceOf($links, LinkInterface::class);
$this->links = $links;
}
+ /** @return LinkInterface[] */
public function getLinks(): array
{
return $this->links;
@@ -36,9 +40,12 @@ public function hasLink(string $linkName): bool
return false;
}
- public function getIterator()
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new ArrayIterator($this->links);
+ return new \ArrayIterator($this->links);
}
public function getLink(string $linkName): ?LinkInterface
@@ -52,6 +59,7 @@ public function getLink(string $linkName): ?LinkInterface
return null;
}
+ /** @return string[] */
public function getLinkNames(): array
{
$linkNames = [];
diff --git a/src/Implementation/Model/Link/LinkObject.php b/src/Implementation/Model/Link/LinkObject.php
index 4799f58..a7946d5 100644
--- a/src/Implementation/Model/Link/LinkObject.php
+++ b/src/Implementation/Model/Link/LinkObject.php
@@ -15,6 +15,9 @@ final class LinkObject implements LinkMemberInterface
/** @var null|MetaInterface */
private $meta;
+ /**
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public function __construct(string $href, ?MetaInterface $meta)
{
$this->href = $href;
diff --git a/src/Implementation/Model/Link/LinkUrl.php b/src/Implementation/Model/Link/LinkUrl.php
index e2aae10..5fa75ba 100644
--- a/src/Implementation/Model/Link/LinkUrl.php
+++ b/src/Implementation/Model/Link/LinkUrl.php
@@ -11,6 +11,9 @@ final class LinkUrl implements LinkMemberInterface
/** @var string */
private $url;
+ /**
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public function __construct(string $url)
{
$this->url = $url;
diff --git a/src/Implementation/Model/Meta/JsonApiMeta.php b/src/Implementation/Model/Meta/JsonApiMeta.php
index 4750fc9..a8bfe7a 100644
--- a/src/Implementation/Model/Meta/JsonApiMeta.php
+++ b/src/Implementation/Model/Meta/JsonApiMeta.php
@@ -4,6 +4,7 @@
namespace Undabot\JsonApi\Implementation\Model\Meta;
-final class JsonApiMeta extends Meta
-{
-}
+/**
+ * @psalm-suppress UnusedClass
+ */
+final class JsonApiMeta extends Meta {}
diff --git a/src/Implementation/Model/Meta/Meta.php b/src/Implementation/Model/Meta/Meta.php
index 82cf65b..703c458 100644
--- a/src/Implementation/Model/Meta/Meta.php
+++ b/src/Implementation/Model/Meta/Meta.php
@@ -8,14 +8,10 @@
class Meta implements MetaInterface
{
- /** @var array */
- private $data = [];
-
- public function __construct(array $data)
- {
- $this->data = $data;
- }
+ /** @param array $data */
+ public function __construct(private array $data) {}
+ /** @return array */
public function getData(): array
{
return $this->data;
diff --git a/src/Implementation/Model/Request/Filter/Filter.php b/src/Implementation/Model/Request/Filter/Filter.php
index 69a771c..d998f33 100644
--- a/src/Implementation/Model/Request/Filter/Filter.php
+++ b/src/Implementation/Model/Request/Filter/Filter.php
@@ -4,16 +4,14 @@
namespace Undabot\JsonApi\Implementation\Model\Request\Filter;
-use InvalidArgumentException;
-
class Filter
{
- /** @var string */
- private $name;
+ private string $name;
/** @var mixed */
private $value;
+ /** @param mixed $value */
public function __construct(string $name, $value)
{
$this->makeSureValueIsValid($value);
@@ -26,23 +24,24 @@ public function getName(): string
return $this->name;
}
- public function getValue()
+ public function getValue(): mixed
{
return $this->value;
}
+ /** @param mixed $value */
private function makeSureValueIsValid($value): void
{
if (true === \is_object($value)) {
- throw new InvalidArgumentException('Filter value can\'t be object');
+ throw new \InvalidArgumentException('Filter value can\'t be object');
}
if (null === $value) {
- throw new InvalidArgumentException('Filter value can\'t be null');
+ throw new \InvalidArgumentException('Filter value can\'t be null');
}
if (true === \is_array($value)) {
- throw new InvalidArgumentException('Filter value can\'t be array');
+ throw new \InvalidArgumentException('Filter value can\'t be array');
}
if (
@@ -50,7 +49,7 @@ private function makeSureValueIsValid($value): void
&& false === \is_float($value)
&& false === \is_int($value)
) {
- throw new InvalidArgumentException('Value must be either string, integer or float');
+ throw new \InvalidArgumentException('Value must be either string, integer or float');
}
}
}
diff --git a/src/Implementation/Model/Request/Filter/FilterSet.php b/src/Implementation/Model/Request/Filter/FilterSet.php
index 760b47a..506051b 100644
--- a/src/Implementation/Model/Request/Filter/FilterSet.php
+++ b/src/Implementation/Model/Request/Filter/FilterSet.php
@@ -4,15 +4,18 @@
namespace Undabot\JsonApi\Implementation\Model\Request\Filter;
-use ArrayIterator;
use Assert\Assertion;
use IteratorAggregate;
-class FilterSet implements IteratorAggregate
+/**
+ * @implements IteratorAggregate
+ */
+class FilterSet implements \IteratorAggregate
{
/** @var Filter[] */
private $filters;
+ /** @param Filter[] $filters */
public function __construct(array $filters)
{
Assertion::allIsInstanceOf($filters, Filter::class);
@@ -20,9 +23,11 @@ public function __construct(array $filters)
}
/**
- * @param array $rawFilters Key value pairs of filters
+ * @param array $rawFilters Key value pairs of filters
+ *
+ * @psalm-suppress PossiblyUnusedMethod
*/
- public static function fromArray(array $rawFilters)
+ public static function fromArray(array $rawFilters): self
{
$filters = [];
@@ -33,9 +38,12 @@ public static function fromArray(array $rawFilters)
return new self($filters);
}
- public function getIterator()
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new ArrayIterator($this->filters);
+ return new \ArrayIterator($this->filters);
}
public function getFilter(string $name): ?Filter
@@ -49,7 +57,8 @@ public function getFilter(string $name): ?Filter
return null;
}
- public function getFilterValue(string $name)
+ /** @psalm-suppress PossiblyUnusedMethod */
+ public function getFilterValue(string $name): mixed
{
$filter = $this->getFilter($name);
if (null === $filter) {
@@ -59,6 +68,11 @@ public function getFilterValue(string $name)
return $filter->getValue();
}
+ /**
+ * @return string[]
+ *
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public function getFilterNames(): array
{
return array_map(
diff --git a/src/Implementation/Model/Request/Sort/Sort.php b/src/Implementation/Model/Request/Sort/Sort.php
index 7494e1f..a65c524 100644
--- a/src/Implementation/Model/Request/Sort/Sort.php
+++ b/src/Implementation/Model/Request/Sort/Sort.php
@@ -4,8 +4,6 @@
namespace Undabot\JsonApi\Implementation\Model\Request\Sort;
-use InvalidArgumentException;
-
/**
* The sort order for each sort field MUST be ascending unless it is prefixed with a minus (U+002D HYPHEN-MINUS, “-“),
* in which case it MUST be descending.
@@ -48,7 +46,7 @@ private function makeSureOrderIsValid(string $order): void
if (false === \in_array($order, [self::SORT_ORDER_ASC, self::SORT_ORDER_DESC], true)) {
$message = sprintf('Sort value must be either ASC or DESC, %s given', $order);
- throw new InvalidArgumentException($message);
+ throw new \InvalidArgumentException($message);
}
}
}
diff --git a/src/Implementation/Model/Request/Sort/SortSet.php b/src/Implementation/Model/Request/Sort/SortSet.php
index 2910791..e9bd71e 100644
--- a/src/Implementation/Model/Request/Sort/SortSet.php
+++ b/src/Implementation/Model/Request/Sort/SortSet.php
@@ -4,21 +4,27 @@
namespace Undabot\JsonApi\Implementation\Model\Request\Sort;
-use ArrayIterator;
use Assert\Assertion;
use IteratorAggregate;
-class SortSet implements IteratorAggregate
+/**
+ * @implements IteratorAggregate
+ */
+class SortSet implements \IteratorAggregate
{
/** @var Sort[] */
- private $sorts;
+ private array $sorts;
+ /** @param Sort[] $sorts */
public function __construct(array $sorts)
{
Assertion::allIsInstanceOf($sorts, Sort::class);
$this->sorts = $sorts;
}
+ /**
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public static function make(string $sortDefinition): self
{
$sorts = [];
@@ -38,11 +44,19 @@ public static function make(string $sortDefinition): self
return new self($sorts);
}
- public function getIterator()
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new ArrayIterator($this->sorts);
+ return new \ArrayIterator($this->sorts);
}
+ /**
+ * @return array
+ *
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public function getSortsArray(): array
{
$sortSet = [];
diff --git a/src/Implementation/Model/Resource/Attribute/Attribute.php b/src/Implementation/Model/Resource/Attribute/Attribute.php
index 91854a2..e2593ab 100644
--- a/src/Implementation/Model/Resource/Attribute/Attribute.php
+++ b/src/Implementation/Model/Resource/Attribute/Attribute.php
@@ -14,6 +14,11 @@ class Attribute implements AttributeInterface
/** @var mixed */
private $value;
+ /**
+ * @param mixed $value
+ *
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public function __construct(string $name, $value)
{
$this->name = $name;
@@ -25,7 +30,7 @@ public function getName(): string
return $this->name;
}
- public function getValue()
+ public function getValue(): mixed
{
return $this->value;
}
diff --git a/src/Implementation/Model/Resource/Attribute/AttributeCollection.php b/src/Implementation/Model/Resource/Attribute/AttributeCollection.php
index 891dcf0..ed7a9a6 100644
--- a/src/Implementation/Model/Resource/Attribute/AttributeCollection.php
+++ b/src/Implementation/Model/Resource/Attribute/AttributeCollection.php
@@ -4,30 +4,34 @@
namespace Undabot\JsonApi\Implementation\Model\Resource\Attribute;
-use ArrayIterator;
-use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Resource\Attribute\AttributeCollectionInterface;
use Undabot\JsonApi\Definition\Model\Resource\Attribute\AttributeInterface;
+/** @psalm-suppress UnusedClass */
class AttributeCollection implements AttributeCollectionInterface
{
- /** @var Attribute[] */
- private $attributes;
+ /** @var AttributeInterface[] */
+ private array $attributes;
+ /** @param AttributeInterface[] $attributes */
public function __construct(array $attributes)
{
$this->makeSureAllAttributesAreValid($attributes);
$this->attributes = $attributes;
}
+ /** @return AttributeInterface[] */
public function getAttributes(): array
{
return $this->attributes;
}
- public function getIterator(): ArrayIterator
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new ArrayIterator($this->getAttributes());
+ return new \ArrayIterator($this->getAttributes());
}
public function getAttributeByName(string $name): ?AttributeInterface
@@ -41,13 +45,14 @@ public function getAttributeByName(string $name): ?AttributeInterface
return null;
}
+ /** @param AttributeInterface[] $attributes */
private function makeSureAllAttributesAreValid(array $attributes): void
{
foreach ($attributes as $attribute) {
if (false === ($attribute instanceof Attribute)) {
$message = sprintf('Attribute expected, %s given', \get_class($attribute));
- throw new InvalidArgumentException($message);
+ throw new \InvalidArgumentException($message);
}
}
}
diff --git a/src/Implementation/Model/Resource/Relationship/Data/ToManyRelationshipData.php b/src/Implementation/Model/Resource/Relationship/Data/ToManyRelationshipData.php
index 8f65e3f..efdb604 100644
--- a/src/Implementation/Model/Resource/Relationship/Data/ToManyRelationshipData.php
+++ b/src/Implementation/Model/Resource/Relationship/Data/ToManyRelationshipData.php
@@ -10,8 +10,7 @@
class ToManyRelationshipData implements ToManyRelationshipDataInterface
{
- /** @var ResourceIdentifierCollectionInterface */
- private $resourceIdentifierCollection;
+ private ResourceIdentifierCollectionInterface $resourceIdentifierCollection;
public function __construct(ResourceIdentifierCollectionInterface $resourceIdentifierCollection)
{
@@ -30,8 +29,7 @@ public static function make(ResourceIdentifierCollectionInterface $resourceIdent
public function isEmpty(): bool
{
- return null === $this->resourceIdentifierCollection
- || 0 === \count($this->resourceIdentifierCollection->getResourceIdentifiers());
+ return 0 === \count($this->resourceIdentifierCollection->getResourceIdentifiers());
}
public function getData(): ResourceIdentifierCollectionInterface
diff --git a/src/Implementation/Model/Resource/Relationship/Relationship.php b/src/Implementation/Model/Resource/Relationship/Relationship.php
index c34dd61..de20b3b 100644
--- a/src/Implementation/Model/Resource/Relationship/Relationship.php
+++ b/src/Implementation/Model/Resource/Relationship/Relationship.php
@@ -4,7 +4,6 @@
namespace Undabot\JsonApi\Implementation\Model\Resource\Relationship;
-use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Link\LinkCollectionInterface;
use Undabot\JsonApi\Definition\Model\Meta\MetaInterface;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\Data\RelationshipDataInterface;
@@ -45,7 +44,7 @@ public function __construct(
if (null === $links
&& null === $data
&& null === $meta) {
- throw new InvalidArgumentException('A “relationship object” MUST contain at least one of the following: links, data, meta');
+ throw new \InvalidArgumentException('A “relationship object” MUST contain at least one of the following: links, data, meta');
}
if (null !== $links) {
@@ -88,10 +87,10 @@ private function makeSureLinksAreEitherSelfOrRelated(LinkCollectionInterface $li
if (0 !== \count($disallowedLinks)) {
$message = sprintf(
'Relationship can only have `self` and `related` links, %s given.',
- (implode(', ', $disallowedLinks))
+ implode(', ', $disallowedLinks)
);
- throw new InvalidArgumentException($message);
+ throw new \InvalidArgumentException($message);
}
// @todo A relationship object that represents a to-many relationship MAY
diff --git a/src/Implementation/Model/Resource/Relationship/RelationshipCollection.php b/src/Implementation/Model/Resource/Relationship/RelationshipCollection.php
index 2dec5ae..364039d 100644
--- a/src/Implementation/Model/Resource/Relationship/RelationshipCollection.php
+++ b/src/Implementation/Model/Resource/Relationship/RelationshipCollection.php
@@ -4,35 +4,39 @@
namespace Undabot\JsonApi\Implementation\Model\Resource\Relationship;
-use ArrayIterator;
-use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\RelationshipCollectionInterface;
use Undabot\JsonApi\Definition\Model\Resource\Relationship\RelationshipInterface;
class RelationshipCollection implements RelationshipCollectionInterface
{
- /** @var array */
- private $relationships = [];
+ /** @var RelationshipInterface[] */
+ private array $relationships = [];
+ /** @param RelationshipInterface[] $relationships */
public function __construct(array $relationships)
{
$this->makeSureThatItemsAreRelationships($relationships);
$this->relationships = $relationships;
}
+ /**
+ * @return RelationshipInterface[]
+ */
public function getRelationships(): array
{
return $this->relationships;
}
- public function getIterator()
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new ArrayIterator($this->getRelationships());
+ return new \ArrayIterator($this->getRelationships());
}
public function getRelationshipByName(string $name): ?RelationshipInterface
{
- /** @var RelationshipInterface $relationship */
foreach ($this->getRelationships() as $relationship) {
if ($name === $relationship->getName()) {
return $relationship;
@@ -42,13 +46,14 @@ public function getRelationshipByName(string $name): ?RelationshipInterface
return null;
}
+ /** @param RelationshipInterface[] $relationships */
private function makeSureThatItemsAreRelationships(array $relationships): void
{
foreach ($relationships as $relationship) {
if (false === ($relationship instanceof Relationship)) {
$message = sprintf('Item must be Relationship object, %s given', \get_class($relationship));
- throw new InvalidArgumentException($message);
+ throw new \InvalidArgumentException($message);
}
}
}
diff --git a/src/Implementation/Model/Resource/Resource.php b/src/Implementation/Model/Resource/Resource.php
index b3d8af0..ea4f50c 100644
--- a/src/Implementation/Model/Resource/Resource.php
+++ b/src/Implementation/Model/Resource/Resource.php
@@ -10,6 +10,7 @@
use Undabot\JsonApi\Definition\Model\Resource\Relationship\RelationshipCollectionInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceInterface;
+/** @psalm-suppress UnusedClass */
class Resource implements ResourceInterface
{
/** @var string */
diff --git a/src/Implementation/Model/Resource/ResourceCollection.php b/src/Implementation/Model/Resource/ResourceCollection.php
index 08768f8..781f743 100644
--- a/src/Implementation/Model/Resource/ResourceCollection.php
+++ b/src/Implementation/Model/Resource/ResourceCollection.php
@@ -4,40 +4,47 @@
namespace Undabot\JsonApi\Implementation\Model\Resource;
-use ArrayIterator;
-use InvalidArgumentException;
+use Assert\Assertion;
+use Assert\AssertionFailedException;
use Undabot\JsonApi\Definition\Model\Resource\ResourceCollectionInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceInterface;
+/** @psalm-suppress UnusedClass */
final class ResourceCollection implements ResourceCollectionInterface
{
- /** @var ResourceInterface[] */
- private $resources;
-
+ /**
+ * @var array
+ */
+ private array $resources;
+
+ /** @param ResourceInterface[] $resources */
+ /** @psalm-suppress PossiblyUnusedMethod */
+ /** @phpstan-ignore-next-line */
public function __construct(array $resources)
{
- $this->makeSureResourcesAreValid($resources);
+ try {
+ Assertion::allIsInstanceOf($resources, ResourceInterface::class);
+ } catch (AssertionFailedException $exception) {
+ // $message = sprintf('ResourceIdentifierInterface expected, %s given', \get_class($resourceIdentifier));
+ //
+ // throw new InvalidArgumentException($message);
+ }
$this->resources = $resources;
}
+ /**
+ * @return ResourceInterface[] $resources
+ */
public function getResources(): array
{
return $this->resources;
}
- public function getIterator()
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new ArrayIterator($this->getResources());
- }
-
- private function makeSureResourcesAreValid(array $resources): void
- {
- foreach ($resources as $resource) {
- if (false === ($resource instanceof ResourceInterface)) {
- $message = sprintf('ResourceInterface expected, %s given', \get_class($resource));
-
- throw new InvalidArgumentException($message);
- }
- }
+ return new \ArrayIterator($this->getResources());
}
}
diff --git a/src/Implementation/Model/Resource/ResourceIdentifierCollection.php b/src/Implementation/Model/Resource/ResourceIdentifierCollection.php
index e7a6a41..1479f31 100644
--- a/src/Implementation/Model/Resource/ResourceIdentifierCollection.php
+++ b/src/Implementation/Model/Resource/ResourceIdentifierCollection.php
@@ -4,7 +4,8 @@
namespace Undabot\JsonApi\Implementation\Model\Resource;
-use ArrayIterator;
+use Assert\Assertion;
+use Assert\AssertionFailedException;
use InvalidArgumentException;
use Undabot\JsonApi\Definition\Model\Resource\ResourceIdentifierCollectionInterface;
use Undabot\JsonApi\Definition\Model\Resource\ResourceIdentifierInterface;
@@ -14,30 +15,32 @@ final class ResourceIdentifierCollection implements ResourceIdentifierCollection
/** @var ResourceIdentifierInterface[] */
private $resourceIdentifiers;
+ /** @param ResourceIdentifierInterface[] $resourceIdentifiers */
public function __construct(array $resourceIdentifiers)
{
- $this->makeSureResourcesIdentifiersAreValid($resourceIdentifiers);
+ try {
+ Assertion::allIsInstanceOf($resourceIdentifiers, ResourceIdentifierInterface::class);
+ } catch (AssertionFailedException $exception) {
+ // $message = sprintf('ResourceIdentifierInterface expected, %s given', \get_class($resourceIdentifier));
+ //
+ // throw new InvalidArgumentException($message);
+ }
$this->resourceIdentifiers = $resourceIdentifiers;
}
+ /**
+ * @return ResourceIdentifierInterface[]
+ */
public function getResourceIdentifiers(): array
{
return $this->resourceIdentifiers;
}
- public function getIterator()
- {
- return new ArrayIterator($this->getResourceIdentifiers());
- }
-
- private function makeSureResourcesIdentifiersAreValid(array $resourceIdentifiers): void
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- foreach ($resourceIdentifiers as $resourceIdentifier) {
- if (false === ($resourceIdentifier instanceof ResourceIdentifierInterface)) {
- $message = sprintf('ResourceIdentifierInterface expected, %s given', \get_class($resourceIdentifier));
-
- throw new InvalidArgumentException($message);
- }
- }
+ return new \ArrayIterator($this->getResourceIdentifiers());
}
}
diff --git a/src/Implementation/Model/Source/Source.php b/src/Implementation/Model/Source/Source.php
index 99153a7..7af2294 100644
--- a/src/Implementation/Model/Source/Source.php
+++ b/src/Implementation/Model/Source/Source.php
@@ -6,6 +6,7 @@
use Undabot\JsonApi\Definition\Model\Source\SourceInterface;
+/** @psalm-suppress UnusedClass */
final class Source implements SourceInterface
{
/**
diff --git a/src/Util/ArrayUtil.php b/src/Util/ArrayUtil.php
index 9519cb2..fb5578c 100644
--- a/src/Util/ArrayUtil.php
+++ b/src/Util/ArrayUtil.php
@@ -9,6 +9,12 @@
*/
abstract class ArrayUtil
{
+ /**
+ * @param array $array
+ * @param array $requiredKeys
+ *
+ * @psalm-suppress PossiblyUnusedMethod
+ */
public static function hasRequiredKeys(array $array, array $requiredKeys): bool
{
$missingRequiredKeys = array_diff($requiredKeys, array_keys($array));
@@ -16,6 +22,11 @@ public static function hasRequiredKeys(array $array, array $requiredKeys): bool
return true === empty($missingRequiredKeys);
}
+ /**
+ * @param array|string> $array
+ *
+ * @psalm-suppress DocblockTypeContradiction
+ */
public static function isMap(array $array): bool
{
$keys = array_keys($array);
@@ -26,4 +37,64 @@ public static function isMap(array $array): bool
return $keys === $nonIntKeys;
}
+
+ /**
+ * Asserts and returns an array with string keys. If the key does not exist in the source array,
+ * it returns an empty array or a specified default value.
+ *
+ * @param array $source the source array from which to extract the value
+ * @param string $key the key to look for in the source array
+ * @param mixed $default The default value to return if the key is not found. Defaults to an empty array.
+ *
+ * @return array the asserted array with string keys and mixed values
+ */
+ public static function assertStringKeyArray(array $source, string $key, $default = []): array
+ {
+ $array = $source[$key] ?? $default;
+
+ if (!\is_array($array)) {
+ throw new \InvalidArgumentException("The value for '{$key}' is not an array.");
+ }
+
+ foreach (array_keys($array) as $key) {
+ if (!\is_string($key)) {
+ throw new \InvalidArgumentException('Array key must be a string.');
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * Asserts and returns a nested array with string keys. If the key does not exist in the source array,
+ * it returns an empty array or a specified default value.
+ *
+ * @param array $source the source array from which to extract the value
+ * @param string $key the key to look for in the source array
+ * @param mixed $default The default value to return if the key is not found. Defaults to an empty array.
+ *
+ * @return array> the asserted nested array with string keys at both levels
+ */
+ public static function assertStringKeyArrayNested(array $source, string $key, $default = []): array
+ {
+ $array = $source[$key] ?? $default;
+
+ if (!\is_array($array)) {
+ throw new \InvalidArgumentException("The value for '{$key}' is not an array.");
+ }
+
+ foreach ($array as $topKey => $nestedArray) {
+ if (!\is_string($topKey)) {
+ throw new \InvalidArgumentException('Top-level key must be a string.');
+ }
+
+ if (!\is_array($nestedArray)) {
+ throw new \InvalidArgumentException("Value under '{$topKey}' must be an array.");
+ }
+
+ $array[$topKey] = self::assertStringKeyArray($nestedArray, $key);
+ }
+
+ return $array;
+ }
}
diff --git a/src/Util/Exception/ValidationException.php b/src/Util/Exception/ValidationException.php
index 61d0cd1..c72b9aa 100644
--- a/src/Util/Exception/ValidationException.php
+++ b/src/Util/Exception/ValidationException.php
@@ -4,33 +4,35 @@
namespace Undabot\JsonApi\Util\Exception;
-use Exception;
-
-class ValidationException extends Exception
+class ValidationException extends \Exception
{
- /**
- * @var null|string
- */
- private $propertyPath;
+ /** @psalm-suppress UnusedProperty */
+ private ?string $propertyPath;
+
+ /** @psalm-suppress UnusedProperty */
+ private mixed $value;
/**
- * @var mixed
+ * @var array
+ *
+ * @psalm-suppress UnusedProperty
*/
- private $value;
+ private array $constraints;
/**
- * @var array
+ * @param array $constraints
+ *
+ * @psalm-suppress UnusedProperty
+ * @psalm-suppress PossiblyUnusedMethod
*/
- private $constraints;
-
public function __construct(
- $message,
- $code = null,
- string $propertyPath = null,
- $value = null,
+ string $message,
+ int $code = null,
+ ?string $propertyPath = null,
+ mixed $value = null,
array $constraints = []
) {
- parent::__construct($message, $code);
+ parent::__construct($message, $code ?? 0);
$this->propertyPath = $propertyPath;
$this->value = $value;
diff --git a/src/Util/ValidMemberNameAssertion.php b/src/Util/ValidMemberNameAssertion.php
index e90d4b4..ac2664a 100644
--- a/src/Util/ValidMemberNameAssertion.php
+++ b/src/Util/ValidMemberNameAssertion.php
@@ -4,6 +4,7 @@
namespace Undabot\JsonApi\Util;
+/** @psalm-suppress UnusedClass */
class ValidMemberNameAssertion
{
public function assert(string $memberName): bool
diff --git a/src/Util/ValidResourceAssertion.php b/src/Util/ValidResourceAssertion.php
index 016788e..eddbd7f 100644
--- a/src/Util/ValidResourceAssertion.php
+++ b/src/Util/ValidResourceAssertion.php
@@ -8,10 +8,14 @@
/**
* @internal
+ *
+ * @psalm-suppress UnusedClass
*/
final class ValidResourceAssertion
{
/**
+ * @param array $resource
+ *
* @throws ValidationException
*/
public static function assert(array $resource): void
diff --git a/src/Util/ValidResourceIdentifierAssertion.php b/src/Util/ValidResourceIdentifierAssertion.php
index 310fe99..67643cf 100644
--- a/src/Util/ValidResourceIdentifierAssertion.php
+++ b/src/Util/ValidResourceIdentifierAssertion.php
@@ -7,6 +7,8 @@
class ValidResourceIdentifierAssertion
{
/**
+ * @param array $resourceIdentifier
+ *
* @throws \Assert\AssertionFailedException
*/
public static function assert(array $resourceIdentifier): void
diff --git a/src/Util/ValidResourceLinkageAssertion.php b/src/Util/ValidResourceLinkageAssertion.php
index 7c04288..c671a72 100644
--- a/src/Util/ValidResourceLinkageAssertion.php
+++ b/src/Util/ValidResourceLinkageAssertion.php
@@ -15,6 +15,8 @@ class ValidResourceLinkageAssertion
* - a single resource identifier object for non-empty to-one relationships.
* - an array of resource identifier objects for non-empty to-many relationships.
*
+ * @param null|array|string> $resourceLinkage
+ *
* @throws ValidationException
*/
public static function assert(?array $resourceLinkage): void
@@ -28,6 +30,7 @@ public static function assert(?array $resourceLinkage): void
}
if (false === ArrayUtil::isMap($resourceLinkage)) {
+ /** @var array> $resourceLinkage */
foreach ($resourceLinkage as $linkItem) {
ValidResourceIdentifierAssertion::assert($linkItem);
}
@@ -35,6 +38,7 @@ public static function assert(?array $resourceLinkage): void
return;
}
+ /** @var array $resourceLinkage */
ValidResourceIdentifierAssertion::assert($resourceLinkage);
}
}
diff --git a/tests/Integration/Encoding/DocumentSerializerTest.php b/tests/Integration/Encoding/DocumentSerializerTest.php
index 6e596dd..815113f 100644
--- a/tests/Integration/Encoding/DocumentSerializerTest.php
+++ b/tests/Integration/Encoding/DocumentSerializerTest.php
@@ -39,6 +39,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Encoding\DocumentToPhpArrayEncoder
*
* @small
@@ -145,7 +146,7 @@ public function testSimpleDocumentIsSerializedCorrectly(): void
}
JSON;
- static::assertJsonStringEqualsJsonString($expectedJson, (string) $serializedJson);
+ self::assertJsonStringEqualsJsonString($expectedJson, (string) $serializedJson);
}
public function testDocumentWithIncludedResourcesIsSerializedCorrectly(): void
@@ -334,6 +335,6 @@ public function testDocumentWithIncludedResourcesIsSerializedCorrectly(): void
}
JSON;
- static::assertJsonStringEqualsJsonString($expectedJson, (string) $serializedJson);
+ self::assertJsonStringEqualsJsonString($expectedJson, (string) $serializedJson);
}
}
diff --git a/tests/Integration/Encoding/MetaSerializerTest.php b/tests/Integration/Encoding/MetaSerializerTest.php
index ef4214b..8d2a037 100644
--- a/tests/Integration/Encoding/MetaSerializerTest.php
+++ b/tests/Integration/Encoding/MetaSerializerTest.php
@@ -12,6 +12,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Encoding\MetaToPhpArrayEncoder
*
* @small
@@ -51,7 +52,7 @@ public function testMetaObjectIsSerializedCorrectly(): void
}
JSON;
- static::assertEquals($expectedJson, $serializedJson);
+ self::assertEquals($expectedJson, $serializedJson);
}
public function testJsonApiObjectIsSerializedCorrectly(): void
@@ -68,6 +69,6 @@ public function testJsonApiObjectIsSerializedCorrectly(): void
}
JSON;
- static::assertEquals($expectedJson, $serializedJson);
+ self::assertEquals($expectedJson, $serializedJson);
}
}
diff --git a/tests/Integration/Encoding/ResourceSerializerTest.php b/tests/Integration/Encoding/ResourceSerializerTest.php
index 0ca5ff8..1a9f88d 100644
--- a/tests/Integration/Encoding/ResourceSerializerTest.php
+++ b/tests/Integration/Encoding/ResourceSerializerTest.php
@@ -29,6 +29,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Encoding\ResourceToPhpArrayEncoder
*
* @small
@@ -102,7 +103,7 @@ public function testSimpleResourceCanBeSerialized(): void
}
JSON;
- static::assertEquals($expectedJson, $serializedJson);
+ self::assertEquals($expectedJson, $serializedJson);
}
public function testComplexResourceCanBeSerialized(): void
@@ -181,6 +182,6 @@ public function testComplexResourceCanBeSerialized(): void
}
JSON;
- static::assertEquals($expectedJson, $serializedJson);
+ self::assertEquals($expectedJson, $serializedJson);
}
}
diff --git a/tests/Unit/Encoding/PhpArray/Encode/DocumentDataToPhpArrayEncoderTest.php b/tests/Unit/Encoding/PhpArray/Encode/DocumentDataToPhpArrayEncoderTest.php
index 8c3540a..72f341e 100644
--- a/tests/Unit/Encoding/PhpArray/Encode/DocumentDataToPhpArrayEncoderTest.php
+++ b/tests/Unit/Encoding/PhpArray/Encode/DocumentDataToPhpArrayEncoderTest.php
@@ -70,7 +70,7 @@ protected function setUp(): void
*/
public function testItCanBeConstructed(): void
{
- static::assertInstanceOf(DocumentDataToPhpArrayEncoderInterface::class, $this->encoder);
+ self::assertInstanceOf(DocumentDataToPhpArrayEncoderInterface::class, $this->encoder);
}
/**
@@ -78,7 +78,7 @@ public function testItCanBeConstructed(): void
*/
public function testItWillReturnNullIfDocumentDataIsNotValidType(): void
{
- static::assertNull($this->encoder->encode($this->documentDataMock));
+ self::assertNull($this->encoder->encode($this->documentDataMock));
}
/**
@@ -87,7 +87,7 @@ public function testItWillReturnNullIfDocumentDataIsNotValidType(): void
public function testResourcePhpArrayEncoderWillBeUsedIfDocumentDataIsInstanceOfResource(): void
{
$this->resourceToPhpArrayEncoderMock
- ->expects(static::once())
+ ->expects(self::once())
->method('encode');
$this->documentDataMock
@@ -103,7 +103,7 @@ public function testResourcePhpArrayEncoderWillBeUsedIfDocumentDataIsInstanceOfR
public function testResourceCollectionPhpArrayEncoderWillBeUsedIfDocumentDataIsInstanceOfResourceCollection(): void
{
$this->resourceCollectionToPhpArrayEncoderMock
- ->expects(static::once())
+ ->expects(self::once())
->method('encode');
$this->documentDataMock
@@ -119,7 +119,7 @@ public function testResourceCollectionPhpArrayEncoderWillBeUsedIfDocumentDataIsI
public function testResourceIdentifierPhpArrayEncoderWillBeUsedIfDocumentDataIsInstanceOfResourceIdentifier(): void
{
$this->resourceIdentifierToPhpArrayEncoderMock
- ->expects(static::once())
+ ->expects(self::once())
->method('encode');
$this->documentDataMock
@@ -135,7 +135,7 @@ public function testResourceIdentifierPhpArrayEncoderWillBeUsedIfDocumentDataIsI
public function testItWillBeUsedIfDocumentDataIsInstanceOfResourceIdentifierCollection(): void
{
$this->resourceIdentifierCollectionToPhpArrayEncoderMock
- ->expects(static::once())
+ ->expects(self::once())
->method('encode');
$this->documentDataMock
diff --git a/tests/Unit/Encoding/PhpArray/Encode/DocumentToPhpArrayEncoderTest.php b/tests/Unit/Encoding/PhpArray/Encode/DocumentToPhpArrayEncoderTest.php
index 51d7813..8cc5b31 100644
--- a/tests/Unit/Encoding/PhpArray/Encode/DocumentToPhpArrayEncoderTest.php
+++ b/tests/Unit/Encoding/PhpArray/Encode/DocumentToPhpArrayEncoderTest.php
@@ -77,8 +77,8 @@ protected function setUp(): void
*/
public function testItCanBeConstructed(): void
{
- static::assertInstanceOf(DocumentToPhpArrayEncoder::class, $this->documentEncoder);
- static::assertInstanceOf(DocumentToPhpArrayEncoderInterface::class, $this->documentEncoder);
+ self::assertInstanceOf(DocumentToPhpArrayEncoder::class, $this->documentEncoder);
+ self::assertInstanceOf(DocumentToPhpArrayEncoderInterface::class, $this->documentEncoder);
}
/**
@@ -99,16 +99,16 @@ public function testEncoderWillCallRespectiveSpecificEncoders(): void
$document->method('getJsonApiMeta')->willReturn($jsonApiMeta);
$document->method('getLinks')->willReturn($links);
- $this->documentDataEncoderMock->expects(static::once())->method('encode');
- $this->errorCollectionEncoderMock->expects(static::once())->method('encode');
- $this->metaEncoderMock->expects(static::exactly(2))->method('encode');
+ $this->documentDataEncoderMock->expects(self::once())->method('encode');
+ $this->errorCollectionEncoderMock->expects(self::once())->method('encode');
+ $this->metaEncoderMock->expects(self::exactly(2))->method('encode');
$encoded = $this->documentEncoder->encode($document);
- static::assertIsArray($encoded);
- static::assertArrayHasKey('data', $encoded);
- static::assertArrayHasKey('errors', $encoded);
- static::assertArrayHasKey('meta', $encoded);
- static::assertArrayHasKey('jsonapi', $encoded);
- static::assertArrayHasKey('links', $encoded);
+ self::assertIsArray($encoded);
+ self::assertArrayHasKey('data', $encoded);
+ self::assertArrayHasKey('errors', $encoded);
+ self::assertArrayHasKey('meta', $encoded);
+ self::assertArrayHasKey('jsonapi', $encoded);
+ self::assertArrayHasKey('links', $encoded);
}
}
diff --git a/tests/Unit/Encoding/PhpArray/Encode/ErrorCollectionToPhpArrayEncoderTest.php b/tests/Unit/Encoding/PhpArray/Encode/ErrorCollectionToPhpArrayEncoderTest.php
index 7ed9c52..458cc05 100644
--- a/tests/Unit/Encoding/PhpArray/Encode/ErrorCollectionToPhpArrayEncoderTest.php
+++ b/tests/Unit/Encoding/PhpArray/Encode/ErrorCollectionToPhpArrayEncoderTest.php
@@ -4,7 +4,6 @@
namespace Undabot\JsonApi\Tests\Unit\Encoding\PhpArray\Encode;
-use ArrayIterator;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Undabot\JsonApi\Definition\Encoding\ErrorCollectionToPhpArrayEncoderInterface;
@@ -15,6 +14,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Encoding\ErrorCollectionToPhpArrayEncoder
*
* @small
@@ -34,8 +34,8 @@ protected function setUp(): void
public function testItCanBeConstructed(): void
{
- static::assertInstanceOf(ErrorCollectionToPhpArrayEncoder::class, $this->errorCollectionEncoder);
- static::assertInstanceOf(ErrorCollectionToPhpArrayEncoderInterface::class, $this->errorCollectionEncoder);
+ self::assertInstanceOf(ErrorCollectionToPhpArrayEncoder::class, $this->errorCollectionEncoder);
+ self::assertInstanceOf(ErrorCollectionToPhpArrayEncoderInterface::class, $this->errorCollectionEncoder);
}
public function testErrorCollectionEncoderWillCallErrorEncoder(): void
@@ -52,12 +52,12 @@ public function testErrorCollectionEncoderWillCallErrorEncoder(): void
];
$errorCollection->method('getErrors')->willReturn($errors);
- $errorCollection->method('getIterator')->willReturn(new ArrayIterator($errors));
+ $errorCollection->method('getIterator')->willReturn(new \ArrayIterator($errors));
- $this->errorEncoder->expects(static::exactly(3))->method('encode');
+ $this->errorEncoder->expects(self::exactly(3))->method('encode');
$encoded = $this->errorCollectionEncoder->encode($errorCollection);
- static::assertIsArray($encoded);
- static::assertCount(3, $encoded);
+ self::assertIsArray($encoded);
+ self::assertCount(3, $encoded);
}
}
diff --git a/tests/Unit/Encoding/PhpArray/Encode/ErrorToPhpArrayEncoderTest.php b/tests/Unit/Encoding/PhpArray/Encode/ErrorToPhpArrayEncoderTest.php
index de70254..d27a3a8 100644
--- a/tests/Unit/Encoding/PhpArray/Encode/ErrorToPhpArrayEncoderTest.php
+++ b/tests/Unit/Encoding/PhpArray/Encode/ErrorToPhpArrayEncoderTest.php
@@ -18,6 +18,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Encoding\ErrorToPhpArrayEncoder
*
* @small
@@ -44,27 +45,27 @@ protected function setUp(): void
public function testItCanBeConstructed(): void
{
- static::assertInstanceOf(ErrorToPhpArrayEncoder::class, $this->errorEncoder);
- static::assertInstanceOf(ErrorToPhpArrayEncoderInterface::class, $this->errorEncoder);
+ self::assertInstanceOf(ErrorToPhpArrayEncoder::class, $this->errorEncoder);
+ self::assertInstanceOf(ErrorToPhpArrayEncoderInterface::class, $this->errorEncoder);
}
public function testEncoderSuccessfullyEncodesPrimitiveValues(): void
{
$error = $this->createMock(ErrorInterface::class);
- $error->expects(static::exactly(2))->method('getId')->willReturn('id');
- $error->expects(static::exactly(2))->method('getStatus')->willReturn('status 1');
- $error->expects(static::exactly(2))->method('getCode')->willReturn('code 1');
- $error->expects(static::exactly(2))->method('getTitle')->willReturn('title 1');
- $error->expects(static::exactly(2))->method('getDetail')->willReturn('detail 1');
+ $error->expects(self::exactly(1))->method('getId')->willReturn('id');
+ $error->expects(self::exactly(1))->method('getStatus')->willReturn('status 1');
+ $error->expects(self::exactly(1))->method('getCode')->willReturn('code 1');
+ $error->expects(self::exactly(1))->method('getTitle')->willReturn('title 1');
+ $error->expects(self::exactly(1))->method('getDetail')->willReturn('detail 1');
$encoded = $this->errorEncoder->encode($error);
- static::assertIsArray($encoded);
- static::assertCount(5, $encoded);
- static::assertSame('id', $encoded['id']);
- static::assertSame('status 1', $encoded['status']);
- static::assertSame('code 1', $encoded['code']);
- static::assertSame('title 1', $encoded['title']);
- static::assertSame('detail 1', $encoded['detail']);
+ self::assertIsArray($encoded);
+ self::assertCount(5, $encoded);
+ self::assertSame('id', $encoded['id']);
+ self::assertSame('status 1', $encoded['status']);
+ self::assertSame('code 1', $encoded['code']);
+ self::assertSame('title 1', $encoded['title']);
+ self::assertSame('detail 1', $encoded['detail']);
}
public function testErrorEncoderWillCallSpecificObjectEncoders(): void
@@ -72,19 +73,19 @@ public function testErrorEncoderWillCallSpecificObjectEncoders(): void
$error = $this->createMock(ErrorInterface::class);
$link = $this->createMock(LinkInterface::class);
- $error->expects(static::exactly(2))->method('getAboutLink')->willReturn($link);
+ $error->expects(self::exactly(1))->method('getAboutLink')->willReturn($link);
$source = $this->createMock(SourceInterface::class);
- $error->expects(static::exactly(2))->method('getSource')->willReturn($source);
+ $error->expects(self::exactly(1))->method('getSource')->willReturn($source);
$meta = $this->createMock(MetaInterface::class);
- $error->expects(static::exactly(2))->method('getMeta')->willReturn($meta);
+ $error->expects(self::exactly(1))->method('getMeta')->willReturn($meta);
$encoded = $this->errorEncoder->encode($error);
- static::assertIsArray($encoded);
- static::assertCount(3, $encoded);
- static::assertArrayHasKey('links', $encoded);
- static::assertArrayHasKey('source', $encoded);
- static::assertArrayHasKey('meta', $encoded);
+ self::assertIsArray($encoded);
+ self::assertCount(3, $encoded);
+ self::assertArrayHasKey('links', $encoded);
+ self::assertArrayHasKey('source', $encoded);
+ self::assertArrayHasKey('meta', $encoded);
}
}
diff --git a/tests/Unit/Encoding/PhpArray/Encode/PhpArrayToRelationshipCollectionEncoderTest.php b/tests/Unit/Encoding/PhpArray/Encode/PhpArrayToRelationshipCollectionEncoderTest.php
index 8ab3705..cc20de3 100644
--- a/tests/Unit/Encoding/PhpArray/Encode/PhpArrayToRelationshipCollectionEncoderTest.php
+++ b/tests/Unit/Encoding/PhpArray/Encode/PhpArrayToRelationshipCollectionEncoderTest.php
@@ -16,6 +16,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Encoding\PhpArrayToRelationshipCollectionEncoder
*
* @small
@@ -46,7 +47,7 @@ public function testValidEmptyRelationshipsArrayIsEncodedToRelationshipsCollecti
$relationshipsCollection = $this->encoder->encode($emptyRelationshipsArray);
- static::assertCount(1, $relationshipsCollection);
+ self::assertCount(1, $relationshipsCollection);
/** @var Relationship $singleRelationship */
$singleRelationship = $relationshipsCollection->getRelationshipByName('fakeResourceName');
@@ -54,12 +55,12 @@ public function testValidEmptyRelationshipsArrayIsEncodedToRelationshipsCollecti
/** @var ToManyRelationshipData $relationshipData */
$relationshipData = $singleRelationship->getData();
- static::assertInstanceOf(ToManyRelationshipData::class, $relationshipData);
+ self::assertInstanceOf(ToManyRelationshipData::class, $relationshipData);
/** @var ToManyRelationshipData $relationships */
$relationships = $singleRelationship->getData();
- static::assertTrue($relationships->isEmpty());
+ self::assertTrue($relationships->isEmpty());
}
public function testValidRelationshipsArrayIsEncodedToRelationshipsCollection(): void
@@ -81,8 +82,8 @@ public function testValidRelationshipsArrayIsEncodedToRelationshipsCollection():
/** @var ResourceIdentifier $resourceIdentifier */
foreach ($relationshipsCollection->getRelationshipByName('fakeResourceName')->getData()->getData()->getResourceIdentifiers() as $resourceIdentifier) {
- static::assertInstanceOf(ResourceIdentifier::class, $resourceIdentifier);
- static::assertNull($resourceIdentifier->getMeta());
+ self::assertInstanceOf(ResourceIdentifier::class, $resourceIdentifier);
+ self::assertNull($resourceIdentifier->getMeta());
}
}
@@ -108,12 +109,12 @@ public function testValidRelationshipsArrayIsEncodedToRelationshipsCollectionWit
$firstResourceIdentifier = $resourceIdentifiers[0] ?? null;
$secondResourceIdentifier = $resourceIdentifiers[1] ?? null;
$thirdResourceIdentifier = $resourceIdentifiers[2] ?? null;
- static::assertInstanceOf(ResourceIdentifier::class, $firstResourceIdentifier);
- static::assertInstanceOf(ResourceIdentifier::class, $secondResourceIdentifier);
- static::assertInstanceOf(ResourceIdentifier::class, $thirdResourceIdentifier);
- static::assertSame([], $firstResourceIdentifier->getMeta()->getData());
- static::assertSame(['foo' => 'bar'], $secondResourceIdentifier->getMeta()->getData());
- static::assertSame(['foo' => ['bar' => 'baz']], $thirdResourceIdentifier->getMeta()->getData());
+ self::assertInstanceOf(ResourceIdentifier::class, $firstResourceIdentifier);
+ self::assertInstanceOf(ResourceIdentifier::class, $secondResourceIdentifier);
+ self::assertInstanceOf(ResourceIdentifier::class, $thirdResourceIdentifier);
+ self::assertSame([], $firstResourceIdentifier->getMeta()->getData());
+ self::assertSame(['foo' => 'bar'], $secondResourceIdentifier->getMeta()->getData());
+ self::assertSame(['foo' => ['bar' => 'baz']], $thirdResourceIdentifier->getMeta()->getData());
}
public function testMissingRelationshipTypeRaisesException(): void
@@ -153,16 +154,16 @@ private function validateRelationship(RelationshipCollectionInterface $relations
/** @var Relationship $singleRelationship */
$singleRelationship = $relationshipsCollection->getRelationshipByName($relationshipName);
- static::assertCount(1, $relationshipsCollection->getRelationships());
+ self::assertCount(1, $relationshipsCollection->getRelationships());
/** @var ToManyRelationshipData $relationshipData */
$relationshipData = $singleRelationship->getData();
- static::assertInstanceOf(ToManyRelationshipData::class, $relationshipData);
+ self::assertInstanceOf(ToManyRelationshipData::class, $relationshipData);
/** @var ToManyRelationshipData $relationships */
$relationships = $singleRelationship->getData();
- static::assertCount(3, $relationships->getData());
+ self::assertCount(3, $relationships->getData());
}
}
diff --git a/tests/Unit/Error/ErrorTest.php b/tests/Unit/Error/ErrorTest.php
index cf09171..c105f9a 100644
--- a/tests/Unit/Error/ErrorTest.php
+++ b/tests/Unit/Error/ErrorTest.php
@@ -13,6 +13,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Error\Error
*
* @small
@@ -38,52 +39,52 @@ final class ErrorTest extends TestCase
public function testItsPossibleToConstructErrorWithIdOnly(): void
{
$error = new Error('e500');
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
public function testItsPossibleToConstructErrorWithLinksOnly(): void
{
$error = new Error(null, new Link('about', new LinkUrl('/error')));
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
public function testItsPossibleToConstructErrorWithStatusOnly(): void
{
$error = new Error(null, null, 'status');
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
public function testItsPossibleToConstructErrorWithCodeOnly(): void
{
$error = new Error(null, null, null, '500');
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
public function testItsPossibleToConstructErrorWithTitleOnly(): void
{
$error = new Error(null, null, null, null, 'Server error');
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
public function testItsPossibleToConstructErrorWithDetailOnly(): void
{
$error = new Error(null, null, null, null, null, 'Server error details');
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
public function testItsPossibleToConstructErrorWithSourceOnly(): void
{
$error = new Error(null, null, null, null, null, null, new Source('/foo/bar'));
- static::assertNotNull($error);
+ self::assertNotNull($error);
$error2 = new Error(null, null, null, null, null, null, new Source('/data/attributes/title', 'foo'));
- static::assertNotNull($error2);
+ self::assertNotNull($error2);
}
public function testItsPossibleToConstructErrorWithMetaOnly(): void
{
$error = new Error(null, null, null, null, null, null, null, new Meta(['foo' => 'bar']));
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
public function testItsPossibleToConstructErrorWithAllAttributes(): void
@@ -99,6 +100,6 @@ public function testItsPossibleToConstructErrorWithAllAttributes(): void
new Meta(['foo' => 'bar'])
);
- static::assertNotNull($error);
+ self::assertNotNull($error);
}
}
diff --git a/tests/Unit/Factory/OffsetBasedPaginationFactoryTest.php b/tests/Unit/Factory/OffsetBasedPaginationFactoryTest.php
index aee7964..4bd7eda 100644
--- a/tests/Unit/Factory/OffsetBasedPaginationFactoryTest.php
+++ b/tests/Unit/Factory/OffsetBasedPaginationFactoryTest.php
@@ -4,13 +4,13 @@
namespace Undabot\JsonApi\Tests\Unit\Factory;
-use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Undabot\JsonApi\Implementation\Factory\PaginationFactory;
use Undabot\JsonApi\Implementation\Model\Request\Pagination\OffsetBasedPagination;
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Request\Pagination\OffsetBasedPagination
*
* @small
@@ -24,22 +24,22 @@ protected function setUp(): void
$this->paginationFactory = new PaginationFactory();
}
- /** @dataProvider validOffsetBasedPaginationParamsProvider */
+ /** @dataProvider provideItCanCreateOffsetBasedPaginationFromValidParamsCases */
public function testItCanCreateOffsetBasedPaginationFromValidParams($params): void
{
$pagination = $this->paginationFactory->fromArray($params);
- static::assertInstanceOf(OffsetBasedPagination::class, $pagination);
+ self::assertInstanceOf(OffsetBasedPagination::class, $pagination);
}
- /** @dataProvider invalidPaginationParamsProvider */
+ /** @dataProvider provideItWillThrowExceptionForInvalidParamsCases */
public function testItWillThrowExceptionForInvalidParams(array $invalidParams): void
{
- $this->expectException(InvalidArgumentException::class);
+ $this->expectException(\InvalidArgumentException::class);
$this->paginationFactory->fromArray($invalidParams);
}
- public function invalidPaginationParamsProvider()
+ public function provideItWillThrowExceptionForInvalidParamsCases(): iterable
{
return [
[
@@ -78,7 +78,7 @@ public function invalidPaginationParamsProvider()
];
}
- public function validOffsetBasedPaginationParamsProvider()
+ public function provideItCanCreateOffsetBasedPaginationFromValidParamsCases(): iterable
{
return [
[
@@ -124,7 +124,7 @@ public function testGetPageNumberWillReturnCorrectNumber(): void
/** @var OffsetBasedPagination $pagination */
$pagination = $this->paginationFactory->fromArray($params);
- static::assertSame(3, $pagination->getOffset());
- static::assertSame(10, $pagination->getSize());
+ self::assertSame(3, $pagination->getOffset());
+ self::assertSame(10, $pagination->getSize());
}
}
diff --git a/tests/Unit/Factory/PageBasedPaginationFactoryTest.php b/tests/Unit/Factory/PageBasedPaginationFactoryTest.php
index c4f5909..41e2e47 100644
--- a/tests/Unit/Factory/PageBasedPaginationFactoryTest.php
+++ b/tests/Unit/Factory/PageBasedPaginationFactoryTest.php
@@ -4,13 +4,13 @@
namespace Undabot\JsonApi\Tests\Unit\Factory;
-use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Undabot\JsonApi\Implementation\Factory\PaginationFactory;
use Undabot\JsonApi\Implementation\Model\Request\Pagination\PageBasedPagination;
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Request\Pagination\PageBasedPagination
*
* @small
@@ -24,22 +24,22 @@ protected function setUp(): void
$this->paginationFactory = new PaginationFactory();
}
- /** @dataProvider validPageBasedPaginationParamsProvider */
+ /** @dataProvider providePaginationFactoryCanCreatePageBasedPaginationFromValidParamsCases */
public function testPaginationFactoryCanCreatePageBasedPaginationFromValidParams($params): void
{
$pagination = $this->paginationFactory->fromArray($params);
- static::assertInstanceOf(PageBasedPagination::class, $pagination);
+ self::assertInstanceOf(PageBasedPagination::class, $pagination);
}
- /** @dataProvider invalidPaginationParamsProvider */
+ /** @dataProvider providePaginationFactoryWillThrowExceptionForInvalidParamsCases */
public function testPaginationFactoryWillThrowExceptionForInvalidParams(array $invalidParams): void
{
- $this->expectException(InvalidArgumentException::class);
+ $this->expectException(\InvalidArgumentException::class);
$this->paginationFactory->fromArray($invalidParams);
}
- public function invalidPaginationParamsProvider()
+ public function providePaginationFactoryWillThrowExceptionForInvalidParamsCases(): iterable
{
return [
[
@@ -78,7 +78,7 @@ public function invalidPaginationParamsProvider()
];
}
- public function validPageBasedPaginationParamsProvider()
+ public function providePaginationFactoryCanCreatePageBasedPaginationFromValidParamsCases(): iterable
{
return [
[
@@ -124,7 +124,7 @@ public function testGetPageNumberWillReturnCorrectNumber(): void
/** @var PageBasedPagination $pagination */
$pagination = $this->paginationFactory->fromArray($params);
- static::assertSame(3, $pagination->getPageNumber());
- static::assertSame(10, $pagination->getSize());
+ self::assertSame(3, $pagination->getPageNumber());
+ self::assertSame(10, $pagination->getSize());
}
}
diff --git a/tests/Unit/Factory/RelationshipDataFactoryTest.php b/tests/Unit/Factory/RelationshipDataFactoryTest.php
index 4213284..37cf3eb 100644
--- a/tests/Unit/Factory/RelationshipDataFactoryTest.php
+++ b/tests/Unit/Factory/RelationshipDataFactoryTest.php
@@ -13,6 +13,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Factory\RelationshipDataFactory
*
* @small
@@ -29,22 +30,22 @@ protected function setUp(): void
public function testFactoryCreatesEmptyToManyDataWhenNullDataGiven(): void
{
$data = $this->factory->make('type', true, null);
- static::assertInstanceOf(ToManyRelationshipData::class, $data);
- static::assertTrue($data->isEmpty());
+ self::assertInstanceOf(ToManyRelationshipData::class, $data);
+ self::assertTrue($data->isEmpty());
}
public function testFactoryCreatesEmptyToManyDataWhenEmptyArrayDataGiven(): void
{
$data = $this->factory->make('type', true, []);
- static::assertInstanceOf(ToManyRelationshipData::class, $data);
- static::assertTrue($data->isEmpty());
+ self::assertInstanceOf(ToManyRelationshipData::class, $data);
+ self::assertTrue($data->isEmpty());
}
public function testFactoryCreatesEmptyToOneDataWhenNullDataGiven(): void
{
$data = $this->factory->make('type', false, null);
- static::assertInstanceOf(ToOneRelationshipData::class, $data);
- static::assertTrue($data->isEmpty());
+ self::assertInstanceOf(ToOneRelationshipData::class, $data);
+ self::assertTrue($data->isEmpty());
}
public function testFactoryRaisesAnExceptionWhenTryingToCreateToOneRelationshipDataWithArrayData(): void
@@ -68,11 +69,11 @@ public function testFactoryRaisesAnExceptionWhenTryingToCreateToManyRelationship
public function testFactoryCreatesToManyData(): void
{
$data = $this->factory->make('type', true, ['1', '2', '3']);
- static::assertInstanceOf(ToManyRelationshipData::class, $data);
- static::assertFalse($data->isEmpty());
+ self::assertInstanceOf(ToManyRelationshipData::class, $data);
+ self::assertFalse($data->isEmpty());
$ids = $data->getData()->getResourceIdentifiers();
- static::assertCount(3, $ids);
+ self::assertCount(3, $ids);
$types = [];
array_walk($ids, static function (ResourceIdentifierInterface &$item) use (&$types): void {
@@ -80,19 +81,19 @@ public function testFactoryCreatesToManyData(): void
$item = $item->getId();
});
- static::assertEquals(['1', '2', '3'], $ids);
- static::assertEquals(['type'], array_unique($types));
+ self::assertEquals(['1', '2', '3'], $ids);
+ self::assertEquals(['type'], array_unique($types));
}
public function testFactoryCreatesToOneData(): void
{
$data = $this->factory->make('type', false, '1');
- static::assertInstanceOf(ToOneRelationshipData::class, $data);
- static::assertFalse($data->isEmpty());
+ self::assertInstanceOf(ToOneRelationshipData::class, $data);
+ self::assertFalse($data->isEmpty());
- static::assertInstanceOf(ResourceIdentifierInterface::class, $data->getData());
+ self::assertInstanceOf(ResourceIdentifierInterface::class, $data->getData());
- static::assertEquals('1', $data->getData()->getId());
- static::assertEquals('type', $data->getData()->getType());
+ self::assertEquals('1', $data->getData()->getId());
+ self::assertEquals('type', $data->getData()->getType());
}
}
diff --git a/tests/Unit/Link/LinkTest.php b/tests/Unit/Link/LinkTest.php
index ecc64e3..54e2ad9 100644
--- a/tests/Unit/Link/LinkTest.php
+++ b/tests/Unit/Link/LinkTest.php
@@ -11,6 +11,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Link\Link
*
* @small
@@ -25,17 +26,17 @@ protected function setUp(): void
}
/**
- * @dataProvider validLinkNames
+ * @dataProvider provideLinkCanBeConstructedWithValidNameOnlyCases
*/
public function testLinkCanBeConstructedWithValidNameOnly(string $validLinkName): void
{
$validLink = new Link($validLinkName, $this->linkUrlMock);
- static::assertInstanceOf(Link::class, $validLink);
+ self::assertInstanceOf(Link::class, $validLink);
}
/**
- * @dataProvider invalidLinkNames
+ * @dataProvider provideLinkCannotBeConstructedWithInvalidNameCases
*/
public function testLinkCannotBeConstructedWithInvalidName(string $invalidLinkName): void
{
@@ -44,7 +45,7 @@ public function testLinkCannotBeConstructedWithInvalidName(string $invalidLinkNa
new Link($invalidLinkName, $this->linkUrlMock);
}
- public function validLinkNames(): array
+ public function provideLinkCanBeConstructedWithValidNameOnlyCases(): iterable
{
return [
['self'],
@@ -52,7 +53,7 @@ public function validLinkNames(): array
];
}
- public function invalidLinkNames(): array
+ public function provideLinkCannotBeConstructedWithInvalidNameCases(): iterable
{
return [
['invalid'],
diff --git a/tests/Unit/Model/Document/DocumentDataTest.php b/tests/Unit/Model/Document/DocumentDataTest.php
index ff105dd..0839007 100644
--- a/tests/Unit/Model/Document/DocumentDataTest.php
+++ b/tests/Unit/Model/Document/DocumentDataTest.php
@@ -13,6 +13,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Document\DocumentData
*
* @small
@@ -23,14 +24,14 @@ public function testItCanBeConstructedWithNullArgument(): void
{
$documentData = new DocumentData(null);
- static::assertInstanceOf(DocumentData::class, $documentData);
+ self::assertInstanceOf(DocumentData::class, $documentData);
}
public function testItCanBeConstructedWithEmptyArrayArgument(): void
{
$documentData = new DocumentData([]);
- static::assertInstanceOf(DocumentData::class, $documentData);
+ self::assertInstanceOf(DocumentData::class, $documentData);
}
public function testItCanBeConstructedWithResourceArgument(): void
@@ -39,7 +40,7 @@ public function testItCanBeConstructedWithResourceArgument(): void
$documentData = new DocumentData($resourceMock);
- static::assertInstanceOf(DocumentData::class, $documentData);
+ self::assertInstanceOf(DocumentData::class, $documentData);
}
public function testItCanBeConstructedWithResourceIdentifierArgument(): void
@@ -48,7 +49,7 @@ public function testItCanBeConstructedWithResourceIdentifierArgument(): void
$documentData = new DocumentData($resourceIdentifierMock);
- static::assertInstanceOf(DocumentData::class, $documentData);
+ self::assertInstanceOf(DocumentData::class, $documentData);
}
public function testItCanBeConstructedWithResourceCollectionArgument(): void
@@ -57,7 +58,7 @@ public function testItCanBeConstructedWithResourceCollectionArgument(): void
$documentData = new DocumentData($resourceCollectionMock);
- static::assertInstanceOf(DocumentData::class, $documentData);
+ self::assertInstanceOf(DocumentData::class, $documentData);
}
public function testItCanBeConstructedWithResourceIdentifierCollectionArgument(): void
@@ -66,11 +67,11 @@ public function testItCanBeConstructedWithResourceIdentifierCollectionArgument()
$documentData = new DocumentData($resourceIdentifierCollectionMock);
- static::assertInstanceOf(DocumentData::class, $documentData);
+ self::assertInstanceOf(DocumentData::class, $documentData);
}
/**
- * @dataProvider provideInvalidConstructorArguments
+ * @dataProvider provideItWillThrowExceptionIfConstructedWithInvalidArgumentCases
*
* @param mixed $invalidArgument
*/
@@ -88,7 +89,7 @@ public function testGetResourceWillReturnDataIfDataIsTypeOfResource(): void
$document = new DocumentData($resourceMock);
- static::assertInstanceOf(ResourceInterface::class, $document->getResource());
+ self::assertInstanceOf(ResourceInterface::class, $document->getResource());
}
public function testGetResourceCollectionWillReturnDataIfDataIsTypeOfResourceCollection(): void
@@ -98,7 +99,7 @@ public function testGetResourceCollectionWillReturnDataIfDataIsTypeOfResourceCol
$document = new DocumentData($resourceCollectionMock);
- static::assertInstanceOf(ResourceCollectionInterface::class, $document->getResourceCollection());
+ self::assertInstanceOf(ResourceCollectionInterface::class, $document->getResourceCollection());
}
public function testGetResourceWillThrowExceptionIfDataIsNotTypeOfResource(): void
@@ -127,7 +128,7 @@ public function testGetResourceCollectionWillThrowExceptionIfDataIsNotTypeOfReso
$document->getResourceCollection();
}
- public function provideInvalidConstructorArguments()
+ public function provideItWillThrowExceptionIfConstructedWithInvalidArgumentCases(): iterable
{
return [
[''], // empty string
diff --git a/tests/Unit/Model/Document/DocumentTest.php b/tests/Unit/Model/Document/DocumentTest.php
index 2e27201..0c69dcd 100644
--- a/tests/Unit/Model/Document/DocumentTest.php
+++ b/tests/Unit/Model/Document/DocumentTest.php
@@ -4,8 +4,6 @@
namespace Undabot\JsonApi\Tests\Unit\Model\Document;
-use ArrayIterator;
-use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Undabot\JsonApi\Definition\Model\Document\DocumentDataInterface;
use Undabot\JsonApi\Definition\Model\Error\ErrorCollectionInterface;
@@ -18,6 +16,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Document\Document
*
* @small
@@ -31,7 +30,7 @@ public function testItCanBeConstructedWithDocumentDataOnly(): void
$document = new Document($documentDataMock);
- static::assertInstanceOf(Document::class, $document);
+ self::assertInstanceOf(Document::class, $document);
}
public function testItCanBeConstructedWithErrorCollectionOnly(): void
@@ -41,7 +40,7 @@ public function testItCanBeConstructedWithErrorCollectionOnly(): void
$document = new Document(null, $errorCollectionMock);
- static::assertInstanceOf(Document::class, $document);
+ self::assertInstanceOf(Document::class, $document);
}
public function testItCanBeConstructedWithMetaOnly(): void
@@ -51,7 +50,7 @@ public function testItCanBeConstructedWithMetaOnly(): void
$document = new Document(null, null, $metaMock);
- static::assertInstanceOf(Document::class, $document);
+ self::assertInstanceOf(Document::class, $document);
}
public function testItMustContainAtLeastOneOfTheRequiredTopLevelMembers(): void
@@ -65,6 +64,7 @@ public function testExceptionWillBeThrownIfDocumentDataAndErrorsCoexist(): void
{
/** @var DocumentDataInterface $documentDataMock */
$documentDataMock = $this->createMock(DocumentDataInterface::class);
+
/** @var ErrorCollectionInterface $errorCollectionMock */
$errorCollectionMock = $this->createMock(ErrorCollectionInterface::class);
@@ -78,18 +78,18 @@ public function testItWillRecognizeInvalidLinkMember(): void
$linkCollection = $this->createMock(LinkCollectionInterface::class);
$invalidLink = $this->createMock(LinkInterface::class);
- $invalidLink->expects(static::exactly(2))
+ $invalidLink->expects(self::exactly(2))
->method('getName')
->willReturn('invalidLink');
- $linkCollection->expects(static::once())
+ $linkCollection->expects(self::once())
->method('getIterator')
- ->willReturn(new ArrayIterator([$invalidLink]));
+ ->willReturn(new \ArrayIterator([$invalidLink]));
/** @var DocumentDataInterface $documentDataMock */
$documentDataMock = $this->createMock(DocumentDataInterface::class);
- $this->expectException(InvalidArgumentException::class);
+ $this->expectException(\InvalidArgumentException::class);
new Document($documentDataMock, null, null, null, $linkCollection);
}
@@ -101,7 +101,7 @@ public function testItWillRecognizeIncludedWithoutPrimaryDataAsInvalid(): void
/** @var ErrorCollectionInterface $errorCollectionMock */
$errorCollectionMock = $this->createMock(ErrorCollectionInterface::class);
- $this->expectException(InvalidArgumentException::class);
+ $this->expectException(\InvalidArgumentException::class);
new Document(null, $errorCollectionMock, null, null, null, $included);
}
}
diff --git a/tests/Unit/Relationship/RelationshipTest.php b/tests/Unit/Relationship/RelationshipTest.php
index 5241360..cfe4175 100644
--- a/tests/Unit/Relationship/RelationshipTest.php
+++ b/tests/Unit/Relationship/RelationshipTest.php
@@ -13,6 +13,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Resource\Relationship\Relationship
*
* @small
@@ -34,7 +35,7 @@ public function testRelationshipCanBeCreatedWithValidLinkCollection(): void
{
$relationship = new Relationship('relationshipName', $this->linksCollection);
- static::assertInstanceOf(Relationship::class, $relationship);
+ self::assertInstanceOf(Relationship::class, $relationship);
}
public function testItCannotBeCreatedWithInvalidLinkCollection(): void
@@ -50,14 +51,14 @@ public function testToOneRelationshipDataCanBeCreatedEmpty(): void
{
$emptyToOneRelationshipData = ToOneRelationshipData::makeEmpty();
- static::assertTrue($emptyToOneRelationshipData->isEmpty());
+ self::assertTrue($emptyToOneRelationshipData->isEmpty());
}
public function testToManyRelationshipDataCanBeCreatedEmpty(): void
{
$emptyToManyRelationshipData = ToManyRelationshipData::makeEmpty();
- static::assertTrue($emptyToManyRelationshipData->isEmpty());
+ self::assertTrue($emptyToManyRelationshipData->isEmpty());
}
public function testRelationshipCanBeCreatedWithNoData(): void
@@ -69,6 +70,6 @@ public function testRelationshipCanBeCreatedWithNoData(): void
/** @var ToOneRelationshipData $relationshipData */
$relationshipData = $emptyRelationship->getData();
- static::assertTrue($relationshipData->isEmpty());
+ self::assertTrue($relationshipData->isEmpty());
}
}
diff --git a/tests/Unit/Resource/Attribute/AttributeCollectionTest.php b/tests/Unit/Resource/Attribute/AttributeCollectionTest.php
index d4c8c34..97d17d1 100644
--- a/tests/Unit/Resource/Attribute/AttributeCollectionTest.php
+++ b/tests/Unit/Resource/Attribute/AttributeCollectionTest.php
@@ -11,6 +11,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Resource\Attribute\AttributeCollection
*
* @small
@@ -23,7 +24,7 @@ public function testItCanBeConstructedWithEmptyArray(): void
$attributeCollection = new AttributeCollection($attributes);
- static::assertInstanceOf(AttributeCollectionInterface::class, $attributeCollection);
+ self::assertInstanceOf(AttributeCollectionInterface::class, $attributeCollection);
}
public function testItCanBeConstructedWithArrayOfAttributes(): void
@@ -32,7 +33,7 @@ public function testItCanBeConstructedWithArrayOfAttributes(): void
$attributeCollection = new AttributeCollection($attributes);
- static::assertInstanceOf(AttributeCollectionInterface::class, $attributeCollection);
+ self::assertInstanceOf(AttributeCollectionInterface::class, $attributeCollection);
}
public function testItWillThrowExceptionIfOneAttributeIsNotInstanceOfAttribute(): void
@@ -65,6 +66,6 @@ public function testGetIteratorWillReturnInstanceOfArrayIterator(): void
$attributeCollection = new AttributeCollection($attributes);
- static::assertInstanceOf(\ArrayIterator::class, $attributeCollection->getIterator());
+ self::assertInstanceOf(\ArrayIterator::class, $attributeCollection->getIterator());
}
}
diff --git a/tests/Unit/Resource/ResourceCreationTest.php b/tests/Unit/Resource/ResourceCreationTest.php
index 017f8e5..96d1dbd 100644
--- a/tests/Unit/Resource/ResourceCreationTest.php
+++ b/tests/Unit/Resource/ResourceCreationTest.php
@@ -20,6 +20,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Resource\Resource
*
* @small
@@ -46,11 +47,11 @@ public function testICanCreateSimpleResource(): void
])
);
- static::assertSame('1', $resource->getId());
- static::assertSame('articles', $resource->getType());
- static::assertNotNull($resource->getAttributes());
- static::assertNotNull($resource->getRelationships());
- static::assertNull($resource->getMeta());
+ self::assertSame('1', $resource->getId());
+ self::assertSame('articles', $resource->getType());
+ self::assertNotNull($resource->getAttributes());
+ self::assertNotNull($resource->getRelationships());
+ self::assertNull($resource->getMeta());
}
public function testICanCreateComplexResource(): void
@@ -85,10 +86,10 @@ public function testICanCreateComplexResource(): void
new Link('self', new LinkUrl('http://example.com/articles/1'))
);
- static::assertSame('1', $resource->getId());
- static::assertSame('articles', $resource->getType());
- static::assertNotNull($resource->getAttributes());
- static::assertNotNull($resource->getRelationships());
- static::assertNull($resource->getMeta());
+ self::assertSame('1', $resource->getId());
+ self::assertSame('articles', $resource->getType());
+ self::assertNotNull($resource->getAttributes());
+ self::assertNotNull($resource->getRelationships());
+ self::assertNull($resource->getMeta());
}
}
diff --git a/tests/Unit/Sort/JsonApiHttpSortModelTest.php b/tests/Unit/Sort/JsonApiHttpSortModelTest.php
index fffe815..132b619 100644
--- a/tests/Unit/Sort/JsonApiHttpSortModelTest.php
+++ b/tests/Unit/Sort/JsonApiHttpSortModelTest.php
@@ -10,6 +10,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Implementation\Model\Request\Sort\SortSet
*
* @small
@@ -21,14 +22,14 @@ public function testSingleAttributeSortSetIsCreatedFromString(): void
$sortDefinition = 'name';
$sortSet = SortSet::make($sortDefinition);
- static::assertInstanceOf(SortSet::class, $sortSet);
+ self::assertInstanceOf(SortSet::class, $sortSet);
/** @var Sort $sort */
$sort = iterator_to_array($sortSet)[0];
- static::assertInstanceOf(Sort::class, $sort);
- static::assertSame('name', $sort->getAttribute());
- static::assertTrue($sort->isAsc());
- static::assertFalse($sort->isDesc());
+ self::assertInstanceOf(Sort::class, $sort);
+ self::assertSame('name', $sort->getAttribute());
+ self::assertTrue($sort->isAsc());
+ self::assertFalse($sort->isDesc());
}
public function testSingleAttributeDescSortSetIsCreatedFromString(): void
@@ -36,14 +37,14 @@ public function testSingleAttributeDescSortSetIsCreatedFromString(): void
$sortDefinition = '-lastName';
$sortSet = SortSet::make($sortDefinition);
- static::assertInstanceOf(SortSet::class, $sortSet);
+ self::assertInstanceOf(SortSet::class, $sortSet);
/** @var Sort $sort */
$sort = iterator_to_array($sortSet)[0];
- static::assertInstanceOf(Sort::class, $sort);
- static::assertSame('lastName', $sort->getAttribute());
- static::assertFalse($sort->isAsc());
- static::assertTrue($sort->isDesc());
+ self::assertInstanceOf(Sort::class, $sort);
+ self::assertSame('lastName', $sort->getAttribute());
+ self::assertFalse($sort->isAsc());
+ self::assertTrue($sort->isDesc());
}
public function testMultipleAttributeSortSetIsCreatedFromString(): void
@@ -51,28 +52,28 @@ public function testMultipleAttributeSortSetIsCreatedFromString(): void
$sortDefinition = 'name,-lastName,author.score,-comment.createdAt';
$sortSet = SortSet::make($sortDefinition);
- static::assertInstanceOf(SortSet::class, $sortSet);
+ self::assertInstanceOf(SortSet::class, $sortSet);
$sortSetArray = iterator_to_array($sortSet);
- static::assertCount(4, $sortSetArray);
+ self::assertCount(4, $sortSetArray);
foreach ($sortSet as $sort) {
- static::assertInstanceOf(Sort::class, $sort);
+ self::assertInstanceOf(Sort::class, $sort);
}
- static::assertSame('name', $sortSetArray[0]->getAttribute());
- static::assertTrue($sortSetArray[0]->isAsc());
- static::assertFalse($sortSetArray[0]->isDesc());
+ self::assertSame('name', $sortSetArray[0]->getAttribute());
+ self::assertTrue($sortSetArray[0]->isAsc());
+ self::assertFalse($sortSetArray[0]->isDesc());
- static::assertSame('lastName', $sortSetArray[1]->getAttribute());
- static::assertFalse($sortSetArray[1]->isAsc());
- static::assertTrue($sortSetArray[1]->isDesc());
+ self::assertSame('lastName', $sortSetArray[1]->getAttribute());
+ self::assertFalse($sortSetArray[1]->isAsc());
+ self::assertTrue($sortSetArray[1]->isDesc());
- static::assertSame('author.score', $sortSetArray[2]->getAttribute());
- static::assertTrue($sortSetArray[2]->isAsc());
- static::assertFalse($sortSetArray[2]->isDesc());
+ self::assertSame('author.score', $sortSetArray[2]->getAttribute());
+ self::assertTrue($sortSetArray[2]->isAsc());
+ self::assertFalse($sortSetArray[2]->isDesc());
- static::assertSame('comment.createdAt', $sortSetArray[3]->getAttribute());
- static::assertFalse($sortSetArray[3]->isAsc());
- static::assertTrue($sortSetArray[3]->isDesc());
+ self::assertSame('comment.createdAt', $sortSetArray[3]->getAttribute());
+ self::assertFalse($sortSetArray[3]->isAsc());
+ self::assertTrue($sortSetArray[3]->isDesc());
}
}
diff --git a/tests/Unit/Util/Assert/ArrayUtilTest.php b/tests/Unit/Util/Assert/ArrayUtilTest.php
index 0b87932..b020807 100644
--- a/tests/Unit/Util/Assert/ArrayUtilTest.php
+++ b/tests/Unit/Util/Assert/ArrayUtilTest.php
@@ -9,6 +9,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Util\ArrayUtil
*
* @small
@@ -18,19 +19,19 @@ final class ArrayUtilTest extends TestCase
public function testItCorrectlyValidatesValidArrays(): void
{
$requiredKeys = ['key1'];
- static::assertTrue(
+ self::assertTrue(
ArrayUtil::hasRequiredKeys(['key1' => 'x'], $requiredKeys)
);
- static::assertTrue(
+ self::assertTrue(
ArrayUtil::hasRequiredKeys(['key1' => 'x', 'key2' => 'x'], $requiredKeys)
);
- static::assertTrue(
+ self::assertTrue(
ArrayUtil::hasRequiredKeys(['key1' => 'x', 'key2' => 'x', 'key3' => 'x'], $requiredKeys)
);
- static::assertTrue(
+ self::assertTrue(
ArrayUtil::hasRequiredKeys(['key1' => 'x', 'key3' => 'x'], $requiredKeys)
);
}
@@ -38,15 +39,15 @@ public function testItCorrectlyValidatesValidArrays(): void
public function testItRecognizesInvalidArrays(): void
{
$requiredKeys = ['key1'];
- static::assertFalse(
+ self::assertFalse(
ArrayUtil::hasRequiredKeys(['key1x' => 'x'], $requiredKeys)
);
- static::assertFalse(
+ self::assertFalse(
ArrayUtil::hasRequiredKeys(['key2' => 'x', 'key3x' => 'x'], $requiredKeys)
);
- static::assertFalse(
+ self::assertFalse(
ArrayUtil::hasRequiredKeys([], $requiredKeys)
);
}
diff --git a/tests/Unit/Util/Assert/ValidJsonResourceAssertionTest.php b/tests/Unit/Util/Assert/ValidJsonResourceAssertionTest.php
index aa7abbf..8f9d2ad 100644
--- a/tests/Unit/Util/Assert/ValidJsonResourceAssertionTest.php
+++ b/tests/Unit/Util/Assert/ValidJsonResourceAssertionTest.php
@@ -10,6 +10,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Util\ValidResourceAssertion
*
* @small
@@ -17,7 +18,7 @@
final class ValidJsonResourceAssertionTest extends TestCase
{
/**
- * @dataProvider validResourceData
+ * @dataProvider provideValidateValidResourceArrayCases
*/
public function testValidateValidResourceArray(array $resource): void
{
@@ -27,7 +28,7 @@ public function testValidateValidResourceArray(array $resource): void
}
/**
- * @dataProvider invalidResourceData
+ * @dataProvider provideValidateInvalidResourceArrayCases
*/
public function testValidateInvalidResourceArray(array $resource): void
{
@@ -35,7 +36,7 @@ public function testValidateInvalidResourceArray(array $resource): void
ValidResourceAssertion::assert($resource);
}
- public function validResourceData()
+ public function provideValidateValidResourceArrayCases(): iterable
{
return [
[
@@ -73,7 +74,7 @@ public function validResourceData()
];
}
- public function invalidResourceData()
+ public function provideValidateInvalidResourceArrayCases(): iterable
{
return [
[
diff --git a/tests/Unit/Util/Assert/ValidJsonResourceIdentifierAssertionTest.php b/tests/Unit/Util/Assert/ValidJsonResourceIdentifierAssertionTest.php
index a83be44..71f7e1c 100644
--- a/tests/Unit/Util/Assert/ValidJsonResourceIdentifierAssertionTest.php
+++ b/tests/Unit/Util/Assert/ValidJsonResourceIdentifierAssertionTest.php
@@ -10,13 +10,14 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Util\ValidResourceIdentifierAssertion
*
* @small
*/
final class ValidJsonResourceIdentifierAssertionTest extends TestCase
{
- public function validResourceIdentifierData()
+ public function provideValidateValidResourceIdentifierArrayCases(): iterable
{
return [
[
@@ -36,7 +37,7 @@ public function validResourceIdentifierData()
}
/**
- * @dataProvider validResourceIdentifierData
+ * @dataProvider provideValidateValidResourceIdentifierArrayCases
*/
public function testValidateValidResourceIdentifierArray(array $resourceIdentifier): void
{
@@ -45,7 +46,7 @@ public function testValidateValidResourceIdentifierArray(array $resourceIdentifi
ValidResourceIdentifierAssertion::assert($resourceIdentifier);
}
- public function invalidResourceIdentifierData()
+ public function provideValidateInvalidResourceIdentifierArrayCases(): iterable
{
return [
[
@@ -97,7 +98,7 @@ public function invalidResourceIdentifierData()
}
/**
- * @dataProvider invalidResourceIdentifierData
+ * @dataProvider provideValidateInvalidResourceIdentifierArrayCases
*/
public function testValidateInvalidResourceIdentifierArray(array $resourceIdentifier): void
{
diff --git a/tests/Unit/Util/Assert/ValidMemberNameAssertionTest.php b/tests/Unit/Util/Assert/ValidMemberNameAssertionTest.php
index cbae5ea..99feb21 100644
--- a/tests/Unit/Util/Assert/ValidMemberNameAssertionTest.php
+++ b/tests/Unit/Util/Assert/ValidMemberNameAssertionTest.php
@@ -9,6 +9,7 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Util\ValidMemberNameAssertion
*
* @small
@@ -23,11 +24,11 @@ protected function setUp(): void
}
/**
- * @dataProvider validMemberNameExamples
+ * @dataProvider provideValidateMemberNameCases
*/
public function testValidateMemberName(string $memberName): void
{
- static::assertTrue($this->assertion->assert($memberName));
+ self::assertTrue($this->assertion->assert($memberName));
}
/**
@@ -36,10 +37,10 @@ public function testValidateMemberName(string $memberName): void
*/
public function testInValidateMemberName(string $memberName): void
{
- static::assertFalse($this->assertion->assert($memberName));
+ self::assertFalse($this->assertion->assert($memberName));
}
- public function validMemberNameExamples(): array
+ public function provideValidateMemberNameCases(): iterable
{
return [
['1'],
@@ -50,7 +51,7 @@ public function validMemberNameExamples(): array
];
}
- public function invalidMemberNameExamples(): array
+ public function invalidMemberNameExamples(): iterable
{
return [
[''],
@@ -74,7 +75,7 @@ public function invalidMemberNameExamples(): array
*
* @see https://jsonapi.org/format/#document-member-names-reserved-characters
*/
- public function reservedCharacters(): array
+ public function reservedCharacters(): iterable
{
return [
['+'],
diff --git a/tests/Unit/Util/Assert/ValidResourceLinkageAssertionTest.php b/tests/Unit/Util/Assert/ValidResourceLinkageAssertionTest.php
index 895710a..65073f4 100644
--- a/tests/Unit/Util/Assert/ValidResourceLinkageAssertionTest.php
+++ b/tests/Unit/Util/Assert/ValidResourceLinkageAssertionTest.php
@@ -10,13 +10,14 @@
/**
* @internal
+ *
* @covers \Undabot\JsonApi\Util\ValidResourceLinkageAssertion
*
* @small
*/
final class ValidResourceLinkageAssertionTest extends TestCase
{
- public function validResourceLinkageData(): array
+ public function provideValidateValidResourceLinkageArrayCases(): iterable
{
return [
[
@@ -39,7 +40,7 @@ public function validResourceLinkageData(): array
}
/**
- * @dataProvider validResourceLinkageData
+ * @dataProvider provideValidateValidResourceLinkageArrayCases
*/
public function testValidateValidResourceLinkageArray(?array $resourceLinkage): void
{
@@ -48,7 +49,7 @@ public function testValidateValidResourceLinkageArray(?array $resourceLinkage):
ValidResourceLinkageAssertion::assert($resourceLinkage);
}
- public function invalidResourceLinkageData(): array
+ public function provideValidateInvalidResourceLinkageArrayCases(): iterable
{
return [
[
@@ -61,7 +62,7 @@ public function invalidResourceLinkageData(): array
}
/**
- * @dataProvider invalidResourceLinkageData
+ * @dataProvider provideValidateInvalidResourceLinkageArrayCases
*/
public function testValidateInvalidResourceLinkageArray(array $resourceLinkage): void
{