Skip to content

Commit 098c180

Browse files
srmnqSaraGfroerer
andauthored
Codestyle with phpcs (#29)
* Add phpcs Co-authored-by: Sara Gfrörer <[email protected]>
1 parent f780f90 commit 098c180

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
"check": [
2121
"@analyze",
2222
"@tests",
23-
"@tests-spec"
23+
"@tests-spec",
24+
"@cs-check"
2425
],
2526
"tests": "phpunit tests",
2627
"analyze": "phpstan analyse --level max",
27-
"tests-spec": "phpspec run --no-interaction"
28+
"tests-spec": "phpspec run --no-interaction",
29+
"cs-check": "phpcs --parallel=50",
30+
"cs-fix": "phpcbf"
2831
},
2932
"require-dev": {
3033
"phpspec/phpspec": "^6.2",

phpcs.xml.dist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version = "1.0"?>
2+
<ruleset name="PSR12 coding standard">
3+
<!-- display progress -->
4+
<arg value="p"/>
5+
<arg name="colors"/>
6+
7+
<!-- inherit rules from: -->
8+
<rule ref="PSR12">
9+
<exclude name="Generic.Files.LineLength"/>
10+
</rule>
11+
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
12+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
13+
<properties>
14+
<property name="ignoreBlankLines" value="false"/>
15+
</properties>
16+
</rule>
17+
18+
<!-- Paths to check -->
19+
<file>src</file>
20+
<file>tests</file>
21+
</ruleset>

src/Check/NumericRangeCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function check(string $key, $value): ResultInterface
4848
$result = $this->child->check($key, $value);
4949

5050
if (!$result->isValid()) {
51-
return $result;
51+
return $result;
5252
}
5353

5454
if ($this->lowerBound > $value) {

src/Type/NullableType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(TypeInterface $child)
1818

1919
public function check(string $key, $value): ResultInterface
2020
{
21-
if($value === null) {
21+
if ($value === null) {
2222
return Result::valid();
2323
}
2424

0 commit comments

Comments
 (0)