diff --git a/.circleci/config.yml b/.circleci/config.yml index 602d095..b3f6528 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -143,7 +143,7 @@ jobs: tag: << parameters.version >> parameters: version: - default: "7.4" + 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.1", <> ] + - equal: [ "8.3", <> ] - equal: [ "", <> ] steps: - run-phpunit-tests: @@ -164,7 +164,7 @@ jobs: condition: not: and: - - equal: [ "8.1", <> ] + - 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..d9d308c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# 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 + +[composer.{json,lock}] +indent_size = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ac10f2a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,16 @@ +# Exclude build/test files from archive +/.circleci export-ignore +/test export-ignore +/.editorconfig export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/docs export-ignore +/Doxyfile export-ignore +/doxygen.tag.xml export-ignore +/DoxygenLayout.xml export-ignore +/phpcs.xml export-ignore +/phpunit.xml export-ignore +/rector.php export-ignore + +# Configure diff output for .php and .phar files. +*.php diff=php diff --git a/.gitignore b/.gitignore index e820736..fb48345 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ /vendor/ -.* +.DS_Store +.ddev +.idea +.phpunit.result.cache composer.lock html !.circleci diff --git a/composer.json b/composer.json index 01cb8d0..360c216 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,15 @@ } ], "require": { - "php": ">7.3 <8.3", + "php": ">7.3 <8.4", "ext-json": "*", - "getdkan/contracts": "^1.0.0" + "getdkan/contracts": "^1.1.3" }, "require-dev": { "phpunit/phpunit": ">8.5.14 <10.0.0", - "rector/rector": "^0.15.17", - "squizlabs/php_codesniffer": "^3.7" + "rector/rector": "@stable", + "squizlabs/php_codesniffer": "^3.7", + "symfony/phpunit-bridge": "^7.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 91698f0..1e1245d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,11 +1,19 @@ + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd" + colors="true"> - src + src + + + + + + + test diff --git a/rector.php b/rector.php index 5b8d159..54fd922 100644 --- a/rector.php +++ b/rector.php @@ -8,8 +8,6 @@ use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; -use Rector\Core\ValueObject\PhpVersion; -use Rector\Set\ValueObject\LevelSetList; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ @@ -17,17 +15,8 @@ __DIR__ . '/test', ]); - // Our base version of PHP. - $rectorConfig->phpVersion(PhpVersion::PHP_74); - $rectorConfig->sets([ - // Interestingly, LevelSetList::UP_TO_PHP_82 does not preserve PHP 7.4, - // so we have to specify all the PHP versions leading up to it if we - // want to keep 7.4 idioms. SetList::PHP_74, - SetList::PHP_80, - SetList::PHP_81, - SetList::PHP_82, // Please no dead code or unneeded variables. SetList::DEAD_CODE, // Try to figure out type hints. @@ -44,6 +33,7 @@ RemoveUselessVarTagRector::class, ]); + $rectorConfig->removeUnusedImports(); $rectorConfig->importNames(); $rectorConfig->importShortClasses(false); }; diff --git a/src/Job/Job.php b/src/Job/Job.php index a5480a0..a1c424b 100644 --- a/src/Job/Job.php +++ b/src/Job/Job.php @@ -55,7 +55,7 @@ public function run(): Result return $this->result; } - private function processDataFromRunIt($data) + private function processDataFromRunIt($data): void { if ($data instanceof Result) { $this->result = $data; @@ -114,6 +114,9 @@ public function getResult(): Result return $this->result; } + /** + * @return mixed + */ #[\ReturnTypeWillChange] public function jsonSerialize() { diff --git a/src/Result.php b/src/Result.php index 48e2c94..565fde6 100644 --- a/src/Result.php +++ b/src/Result.php @@ -18,7 +18,7 @@ class Result implements HydratableInterface private string $data = ""; private string $error = ""; - public function setStatus($status) + public function setStatus($status): void { $statuss = [self::WAITING, self::STOPPED, self::IN_PROGRESS, self::ERROR, self::DONE]; if (in_array($status, $statuss)) { @@ -53,6 +53,9 @@ public function getError(): string return $this->error; } + /** + * @return mixed + */ #[\ReturnTypeWillChange] public function jsonSerialize() {