Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 3e000d1

Browse files
authored
Merge pull request #547 from dunglas/yoda-style
Add more php-cs-fixer rules
2 parents 4a3209c + 316dd0b commit 3e000d1

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.php_cs.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ return PhpCsFixer\Config::create()
1212
'cast_spaces' => true,
1313
'concat_space' => ['spacing' => 'one'],
1414
'function_typehint_space' => true,
15+
'general_phpdoc_annotation_remove' => ['author'],
1516
'linebreak_after_opening_tag' => true,
1617
'lowercase_cast' => true,
1718
'mb_str_functions' => true,
@@ -50,6 +51,9 @@ return PhpCsFixer\Config::create()
5051
'ordered_imports' => true,
5152
'php_unit_construct' => true,
5253
'php_unit_dedicate_assert' => true,
54+
'php_unit_expectation' => true,
55+
'php_unit_mock' => true,
56+
'php_unit_no_expectation_annotation' => true,
5357
'phpdoc_add_missing_param_annotation' => true,
5458
'phpdoc_indent' => true,
5559
'phpdoc_no_access' => true,
@@ -73,6 +77,7 @@ return PhpCsFixer\Config::create()
7377
'unary_operator_spaces' => true,
7478
'visibility_required' => true,
7579
'whitespace_after_comma_in_array' => true,
80+
'yoda_style' => false,
7681
])
7782
->setRiskyAllowed(true)
7883
->setFinder($finder);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
},
4646
"scripts": {
4747
"codestyle:check": [
48-
"vendor/bin/php-cs-fixer fix --diff --dry-run",
48+
"vendor/bin/php-cs-fixer fix --diff --diff-format=udiff --dry-run -vvv --ansi",
4949
"vendor/bin/phpcs --standard=PSR2 ./lib/ ./tests/"
5050
],
5151
"codestyle:fix": [
52-
"vendor/bin/php-cs-fixer fix --diff || exit 0",
52+
"vendor/bin/php-cs-fixer fix --diff --diff-format=udiff -vvv || exit 0",
5353
"vendor/bin/phpcbf --standard=PSR2 ./lib/ ./tests/"
5454
],
5555
"analyze": [

tests/unit/Remote/DesiredCapabilitiesTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ public function testShouldProvideAccessToCapabilitiesUsingSettersAndGetters()
6262
$this->assertSame(333, $capabilities->getVersion());
6363
}
6464

65-
/**
66-
* @expectedException \Exception
67-
* @expectedExceptionMessage isJavascriptEnabled() is a htmlunit-only option
68-
*/
6965
public function testShouldNotAllowToDisableJavascriptForNonHtmlUnitBrowser()
7066
{
67+
$this->expectException(\Exception::class);
68+
$this->expectExceptionMessage('isJavascriptEnabled() is a htmlunit-only option');
69+
7170
$capabilities = new DesiredCapabilities();
7271
$capabilities->setBrowserName(WebDriverBrowserType::FIREFOX);
7372
$capabilities->setJavascriptEnabled(false);

0 commit comments

Comments
 (0)