Skip to content

Commit 5a5adb0

Browse files
committed
Include PHP Code Sniffer
1 parent 5523aec commit 5a5adb0

4 files changed

Lines changed: 95 additions & 19 deletions

File tree

composer.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"require-dev": {
3333
"jakub-onderka/php-parallel-lint": "^0.9",
3434
"jakub-onderka/php-console-highlighter": "^0.3",
35+
"squizlabs/php_codesniffer": "^2.7",
3536
"phpunit/phpunit": "^5.5",
3637
"symfony/var-dumper": "^3.1"
3738
},
@@ -51,17 +52,14 @@
5152
},
5253
"prefer-stable": true,
5354
"scripts": {
54-
"post-create-project-cmd": [
55-
"composer update"
56-
],
57-
"lint": [
58-
"parallel-lint . --exclude vendor"
59-
],
60-
"phpunit": [
61-
"phpunit --configuration phpunit.xml"
62-
],
55+
"post-create-project-cmd": "composer update",
56+
"lint": "parallel-lint . --exclude vendor",
57+
"style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
58+
"fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
59+
"phpunit": "phpunit --configuration phpunit.xml",
6360
"test": [
6461
"parallel-lint . --exclude vendor",
62+
"phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
6563
"phpunit --configuration phpunit.xml"
6664
]
6765
}

composer.lock

Lines changed: 85 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Codelyber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ final class Codelyber
1212
/** @var string */
1313
private $name;
1414

15-
public function __construct(string $a_name)
15+
public function __construct(string $aName)
1616
{
17-
$this->name = $a_name;
17+
$this->name = $aName;
1818
}
1919

2020
public function name(): string

tests/CodelyberTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function tearDown()
2424
}
2525

2626
/** @test */
27-
public function should_say_hello_when_greeting()
27+
public function shouldSayHelloWhenGreeting()
2828
{
2929
$this->givenACodelyber();
3030

0 commit comments

Comments
 (0)