From 84b6a18307cc2c84c7c5c7ae6a040a4af7199f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 30 Dec 2021 18:01:05 +0100 Subject: [PATCH 1/2] Enhancement: Use Php74 rule set --- .php-cs-fixer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index eb1b8aad..821d933d 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -26,7 +26,7 @@ $license->save(); -$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php73($license->header())); +$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php74($license->header())); $config->getFinder() ->exclude([ From d214c6e64b763edb1ee8293f3f07d679469fbb44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 30 Dec 2021 18:01:45 +0100 Subject: [PATCH 2/2] Fix: Run 'make coding-standards' --- src/Construct.php | 7 ++---- src/Exception/DirectoryDoesNotExist.php | 5 +---- src/Exception/MultipleDefinitionsFound.php | 2 +- test/Unit/ConstructsTest.php | 5 +---- test/Util/PhpVersion.php | 5 +---- test/Util/Scenario.php | 25 +++++----------------- 6 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/Construct.php b/src/Construct.php index 0c9c62df..449a11b9 100644 --- a/src/Construct.php +++ b/src/Construct.php @@ -18,15 +18,12 @@ */ final class Construct { - /** - * @var string - */ - private $name; + private string $name; /** * @var array */ - private $fileNames = []; + private array $fileNames = []; private function __construct(string $name) { diff --git a/src/Exception/DirectoryDoesNotExist.php b/src/Exception/DirectoryDoesNotExist.php index c63eccd1..e8e62ed9 100644 --- a/src/Exception/DirectoryDoesNotExist.php +++ b/src/Exception/DirectoryDoesNotExist.php @@ -15,10 +15,7 @@ final class DirectoryDoesNotExist extends \InvalidArgumentException implements ExceptionInterface { - /** - * @var string - */ - private $directory; + private string $directory; /** * Returns a new exception from a directory. diff --git a/src/Exception/MultipleDefinitionsFound.php b/src/Exception/MultipleDefinitionsFound.php index dd8a60ac..eff3a2e0 100644 --- a/src/Exception/MultipleDefinitionsFound.php +++ b/src/Exception/MultipleDefinitionsFound.php @@ -20,7 +20,7 @@ final class MultipleDefinitionsFound extends \RuntimeException implements Except /** * @var array */ - private $constructs; + private array $constructs; /** * Returns a new exception from constructs. diff --git a/test/Unit/ConstructsTest.php b/test/Unit/ConstructsTest.php index 2cd0c339..b45954fb 100644 --- a/test/Unit/ConstructsTest.php +++ b/test/Unit/ConstructsTest.php @@ -31,10 +31,7 @@ */ final class ConstructsTest extends Framework\TestCase { - /** - * @var string - */ - private $fileWithParseError = __DIR__ . '/../Fixture/ParseError/MessedUp.php'; + private string $fileWithParseError = __DIR__ . '/../Fixture/ParseError/MessedUp.php'; protected function setUp(): void { diff --git a/test/Util/PhpVersion.php b/test/Util/PhpVersion.php index 8919bfd8..41ce0ead 100644 --- a/test/Util/PhpVersion.php +++ b/test/Util/PhpVersion.php @@ -18,10 +18,7 @@ */ final class PhpVersion { - /** - * @var int - */ - private $value; + private int $value; private function __construct(int $value) { diff --git a/test/Util/Scenario.php b/test/Util/Scenario.php index 3f296eec..7bf673ce 100644 --- a/test/Util/Scenario.php +++ b/test/Util/Scenario.php @@ -20,30 +20,15 @@ */ final class Scenario { - /** - * @var PhpVersion - */ - private $phpVersion; - - /** - * @var string - */ - private $description; - - /** - * @var string - */ - private $fileName; - - /** - * @var string - */ - private $fileContent; + private PhpVersion $phpVersion; + private string $description; + private string $fileName; + private string $fileContent; /** * @var array */ - private $constructs; + private array $constructs; private function __construct( PhpVersion $phpVersion,