Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 7bdb460

Browse files
kubawerloskeradus
authored andcommitted
Update CS (#43)
1 parent 761373a commit 7bdb460

10 files changed

+30
-58
lines changed

.php_cs.dist

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,12 @@ EOF;
1111

1212
return PhpCsFixer\Config::create()
1313
->setRiskyAllowed(true)
14-
->setRules(array(
15-
'@Symfony' => true,
16-
'@Symfony:risky' => true,
17-
'align_multiline_comment' => true,
18-
'array_indentation' => true,
19-
'array_syntax' => ['syntax' => 'short'],
20-
'blank_line_before_statement' => true,
21-
'combine_consecutive_issets' => true,
22-
'combine_consecutive_unsets' => true,
23-
'comment_to_phpdoc' => true,
24-
'compact_nullable_typehint' => true,
25-
'escape_implicit_backslashes' => true,
26-
'explicit_indirect_variable' => true,
27-
'explicit_string_variable' => true,
28-
'final_internal_class' => true,
29-
'fully_qualified_strict_types' => true,
30-
'function_to_constant' => ['functions' => ['get_class', 'get_called_class', 'php_sapi_name', 'phpversion', 'pi']],
14+
->setRules([
15+
'@PhpCsFixer' => true,
16+
'@PhpCsFixer:risky' => true,
3117
'header_comment' => ['header' => $header],
32-
'heredoc_to_nowdoc' => true,
33-
'list_syntax' => ['syntax' => 'long'],
34-
'logical_operators' => true,
35-
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
36-
'method_chaining_indentation' => true,
37-
'multiline_comment_opening_closing' => true,
38-
'no_alternative_syntax' => true,
39-
'no_binary_string' => true,
40-
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
41-
'no_null_property_initialization' => true,
42-
'no_short_echo_tag' => true,
43-
'no_superfluous_elseif' => true,
44-
'no_unneeded_curly_braces' => true,
45-
'no_unneeded_final_method' => true,
46-
'no_unreachable_default_argument_value' => true,
47-
'no_unset_on_property' => true,
48-
'no_useless_else' => true,
49-
'no_useless_return' => true,
50-
'ordered_class_elements' => true,
51-
'ordered_imports' => true,
52-
'phpdoc_add_missing_param_annotation' => true,
53-
'phpdoc_order' => true,
54-
'phpdoc_trim_consecutive_blank_line_separation' => true,
55-
'phpdoc_types_order' => true,
56-
'return_assignment' => true,
57-
'semicolon_after_instruction' => true,
58-
'single_line_comment_style' => true,
59-
'strict_comparison' => true,
60-
'strict_param' => true,
61-
))
18+
'php_unit_strict' => false,
19+
])
6220
->setFinder(
6321
PhpCsFixer\Finder::create()
6422
->in(__DIR__)

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress"
2424

2525
stages:
26-
- Static Code Analysis
26+
- Static code analysis
2727
- Test
2828

2929
before_install:
@@ -66,8 +66,8 @@ script:
6666
jobs:
6767
include:
6868
-
69-
stage: Static Code Analysis
70-
php: 7.1
69+
stage: Static code analysis
70+
php: 7.3
7171
install:
7272
- travis_retry composer update -d dev-tools $DEFAULT_COMPOSER_FLAGS
7373
- composer info -d dev-tools -D | sort

dev-tools/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"require": {
3-
"php": "^7.0"
3+
"php": "^7.3"
44
},
55
"require-dev": {
6-
"friendsofphp/php-cs-fixer": "^2.3",
6+
"friendsofphp/php-cs-fixer": "^2.14",
77
"localheinz/composer-normalize": "^1.1",
8-
"mi-schi/phpmd-extension": "^4.2",
9-
"phpmd/phpmd": "^2.4.3"
8+
"mi-schi/phpmd-extension": "^4.3",
9+
"phpmd/phpmd": "^2.6"
1010
},
1111
"conflict": {
1212
"hhvm": "*"

tests/AutoReviewTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
/**
1717
* @coversNothing
18+
*
19+
* @internal
1820
*/
1921
final class AutoReviewTest extends TestCase
2022
{

tests/ExpectOverSetExceptionTraitTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
/**
1919
* @covers \PHPUnitGoodPractices\Traits\ExpectOverSetExceptionTrait
20+
*
21+
* @internal
2022
*/
2123
final class ExpectOverSetExceptionTraitTest extends TestCase
2224
{
@@ -25,15 +27,15 @@ final class ExpectOverSetExceptionTraitTest extends TestCase
2527

2628
public $violations = [];
2729

28-
public function setUp()
30+
protected function setUp()
2931
{
3032
$this->violations = [];
3133
$self = $this;
3234
$customReporter = function ($issue) use ($self) { $self->violations[] = $issue; };
3335
Reporter::setCustomReporter($customReporter);
3436
}
3537

36-
public function tearDown()
38+
protected function tearDown()
3739
{
3840
Reporter::clearCustomReporter();
3941
}

tests/ExpectationViaCodeOverAnnotationTraitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
/**
1919
* @covers \PHPUnitGoodPractices\Traits\ExpectationViaCodeOverAnnotationTrait
20+
*
21+
* @internal
2022
*/
2123
final class ExpectationViaCodeOverAnnotationTraitTest extends TestCase
2224
{

tests/IdentityOverEqualityTraitTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
/**
2020
* @covers \PHPUnitGoodPractices\Traits\IdentityOverEqualityTrait
21+
*
22+
* @internal
2123
*/
2224
final class IdentityOverEqualityTraitTest extends TestCase
2325
{
@@ -26,7 +28,7 @@ final class IdentityOverEqualityTraitTest extends TestCase
2628
public $fixtureAttributeBool = true;
2729
public $fixtureAttributeInt = 123;
2830

29-
public function tearDown()
31+
protected function tearDown()
3032
{
3133
Reporter::clearCustomReporter();
3234
}

tests/ProphecyOverMockObjectTraitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
/**
2020
* @covers \PHPUnitGoodPractices\Traits\ProphecyOverMockObjectTrait
21+
*
22+
* @internal
2123
*/
2224
final class ProphecyOverMockObjectTraitTest extends TestCase
2325
{

tests/ProphesizeOnlyInterfaceTraitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ interface FixtureInterface
2222

2323
/**
2424
* @covers \PHPUnitGoodPractices\Traits\ProphesizeOnlyInterfaceTrait
25+
*
26+
* @internal
2527
*/
2628
final class ProphesizeOnlyInterfaceTraitTest extends TestCase
2729
{

tests/ReporterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818

1919
/**
2020
* @covers \PHPUnitGoodPractices\Traits\Reporter
21+
*
22+
* @internal
2123
*/
2224
final class ReporterTest extends TestCase
2325
{
2426
use IdentityOverEqualityTrait;
2527

26-
public function tearDown()
28+
protected function tearDown()
2729
{
2830
// reset global `Reporter` state
2931
Reporter::useHeader(true);

0 commit comments

Comments
 (0)