From 177657d5f45f701045643bc011a458effa8d3ad9 Mon Sep 17 00:00:00 2001 From: Henrique Moody Date: Sat, 27 Jan 2024 19:35:11 +0100 Subject: [PATCH] Upgrade Coding Standards For now, I'm ignoring many rules because they'll make the changes that would bring backward compatibility breaks, and I'm aiming to release a minor version next. However, upgrading "respect/coding-standard" is necessary because version 4.0 no longer works. Signed-off-by: Henrique Moody --- composer.json | 2 +- library/Rules/CurrencyCode.php | 2 ++ library/Rules/Json.php | 1 + phpcs.xml.dist | 11 ++++++++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 50a7dae3..ee9ee1bb 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpstan/phpstan-phpunit": "^1.3", "phpunit/phpunit": "^9.6", "psr/http-message": "^1.0", - "respect/coding-standard": "^3.0", + "respect/coding-standard": "^4.0", "squizlabs/php_codesniffer": "^3.7" }, "suggest": { diff --git a/library/Rules/CurrencyCode.php b/library/Rules/CurrencyCode.php index 4c3ab895..c0f91d31 100644 --- a/library/Rules/CurrencyCode.php +++ b/library/Rules/CurrencyCode.php @@ -23,6 +23,8 @@ final class CurrencyCode extends AbstractSearcher * @see http://www.currency-iso.org/en/home/tables/table-a1.html * * {@inheritDoc} + * + * @return string[] */ protected function getDataSource($input = null): array { diff --git a/library/Rules/Json.php b/library/Rules/Json.php index 5ce14fc0..64b263f5 100644 --- a/library/Rules/Json.php +++ b/library/Rules/Json.php @@ -13,6 +13,7 @@ use function function_exists; use function is_string; use function json_decode; use function json_last_error; +use function json_validate; use const JSON_ERROR_NONE; diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 15934dc3..1ef752f9 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -14,5 +14,14 @@ library/ tests/ - + + + + + + + + + +