diff --git a/composer.json b/composer.json index 0c80ab7..f9e81c6 100644 --- a/composer.json +++ b/composer.json @@ -20,11 +20,14 @@ "check": [ "@analyze", "@tests", - "@tests-spec" + "@tests-spec", + "@cs-check" ], "tests": "phpunit tests", "analyze": "phpstan analyse --level max", - "tests-spec": "phpspec run --no-interaction" + "tests-spec": "phpspec run --no-interaction", + "cs-check": "phpcs --parallel=50", + "cs-fix": "phpcbf" }, "require-dev": { "phpspec/phpspec": "^6.2", diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..1c5e692 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + src + tests + \ No newline at end of file diff --git a/src/Check/NumericRangeCheck.php b/src/Check/NumericRangeCheck.php index 581ccee..ef3dc38 100644 --- a/src/Check/NumericRangeCheck.php +++ b/src/Check/NumericRangeCheck.php @@ -48,7 +48,7 @@ public function check(string $key, $value): ResultInterface $result = $this->child->check($key, $value); if (!$result->isValid()) { - return $result; + return $result; } if ($this->lowerBound > $value) { diff --git a/src/Type/NullableType.php b/src/Type/NullableType.php index 56b8a97..f3eb64e 100644 --- a/src/Type/NullableType.php +++ b/src/Type/NullableType.php @@ -18,7 +18,7 @@ public function __construct(TypeInterface $child) public function check(string $key, $value): ResultInterface { - if($value === null) { + if ($value === null) { return Result::valid(); }