From 0951c8c52635fca85d9a2fca77fad71e6d0a2fcf Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Tue, 28 May 2024 10:41:44 -0700 Subject: [PATCH] support PHP 8.3 --- .circleci/config.yml | 8 ++++---- .editorconfig | 13 +++++++++++++ rector.php | 6 ++---- src/RootedJsonData.php | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 .editorconfig diff --git a/.circleci/config.yml b/.circleci/config.yml index 6bcb9dd..37ecf0c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -143,7 +143,7 @@ jobs: tag: << parameters.version >> parameters: version: - default: "8.2" + default: "8.3" description: The `cimg/php` Docker image version tag. type: string install-flags: @@ -154,7 +154,7 @@ jobs: - when: condition: and: - - equal: [ "8.2", <> ] + - equal: [ "8.3", <> ] - equal: [ "", <> ] steps: - run-phpunit-tests: @@ -164,7 +164,7 @@ jobs: condition: not: and: - - equal: [ "8.2", <> ] + - equal: [ "8.3", <> ] - equal: [ "", <> ] steps: - run-phpunit-tests: @@ -176,5 +176,5 @@ workflows: - matrix-conditions: matrix: parameters: - version: ["7.4", "8.0", "8.1", "8.2"] + version: ["7.4", "8.0", "8.1", "8.2", "8.3"] install-flags: ["", "--prefer-lowest"] diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0c0f86f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# @see http://editorconfig.org/ + +# This is the top-most .editorconfig file; do not search in parent directories. +root = true + +# All files. +[*] +end_of_line = LF +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/rector.php b/rector.php index 4da4268..3def543 100644 --- a/rector.php +++ b/rector.php @@ -3,7 +3,6 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Core\ValueObject\PhpVersion; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; @@ -13,8 +12,6 @@ return static function (RectorConfig $rectorConfig): void { - $rectorConfig->phpVersion(PhpVersion::PHP_74); - $rectorConfig->paths([ __DIR__ . '/src', __DIR__ . '/test', @@ -22,11 +19,11 @@ ]); $rectorConfig->sets([ + SetList::PHP_74, // Please no dead code or unneeded variables. SetList::DEAD_CODE, // Try to figure out type hints. SetList::TYPE_DECLARATION, - SetList::PHP_82, ]); $rectorConfig->skip([ @@ -39,6 +36,7 @@ RemoveUselessVarTagRector::class, ]); + $rectorConfig->removeUnusedImports(); $rectorConfig->importNames(); $rectorConfig->importShortClasses(false); }; diff --git a/src/RootedJsonData.php b/src/RootedJsonData.php index 4b5b6c3..5a9ebf7 100644 --- a/src/RootedJsonData.php +++ b/src/RootedJsonData.php @@ -72,7 +72,7 @@ public static function validate(string $json, string $schema): ValidationResult * * @return string */ - public function __toString() + public function __toString(): string { return $this->data->getJson(); }