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

Commit 60d8eb5

Browse files
authored
Develop (#10)
* Updated php-cs-fixer to stable v2 | added new tests | remove scrutinizer yml and changelog * fix test * remove old test * dont use simplified_null_return | added test for long array
1 parent a38c847 commit 60d8eb5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getRules(): array
145145
'semicolon_after_instruction' => true,
146146
'short_scalar_cast' => true,
147147
'silenced_deprecation_error' => false,
148-
'simplified_null_return' => true,
148+
'simplified_null_return' => false,
149149
'single_blank_line_before_namespace' => false,
150150
'single_quote' => true,
151151
'space_after_semicolon' => true,

tests/ConfigTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ public function testDoesNotHaveRulesEnabled(string $fixer, $reason)
118118
$fixer => false,
119119
];
120120

121-
if (! is_array($reason)) {
121+
if ($fixer === 'array_syntax') {
122+
$this->assertNotSame(['syntax' => 'long'], $config->getRules()['array_syntax'], sprintf(
123+
'Fixer "%s" should not be enabled, because "%s"',
124+
$fixer,
125+
$reason['long']
126+
));
127+
} else {
122128
$this->assertArraySubset($rule, $config->getRules(), true, sprintf(
123129
'Fixer "%s" should not be enabled, because "%s"',
124130
$fixer,
@@ -133,7 +139,7 @@ public function testDoesNotHaveRulesEnabled(string $fixer, $reason)
133139
public function providerDoesNotHaveFixerEnabled(): array
134140
{
135141
$symfonyFixers = [
136-
'self_accessor' => 'it causes an edge case error',
142+
'self_accessor' => 'it causes an edge case error',
137143
];
138144

139145
$contribFixers = [
@@ -148,6 +154,7 @@ public function providerDoesNotHaveFixerEnabled(): array
148154
'psr0' => 'we are using PSR-4',
149155
'strict_comparison' => 'it changes behaviour',
150156
'strict_param' => 'it changes behaviour',
157+
'simplified_null_return' => 'it changes behaviour on void return'
151158
];
152159

153160
$fixers = array_merge($contribFixers, $symfonyFixers);
@@ -311,7 +318,7 @@ protected function getContribRules(): array
311318
'psr0' => false,
312319
'psr4' => true,
313320
'semicolon_after_instruction' => true,
314-
'simplified_null_return' => true,
321+
'simplified_null_return' => false,
315322
'strict_comparison' => false,
316323
'strict_param' => false,
317324
];

0 commit comments

Comments
 (0)