Skip to content

Commit 1ecae2f

Browse files
authored
Merge pull request #5265 from paulbalandan/ordered_class_elements
Enable `ordered_class_elements` rule
2 parents e0d48a1 + 6a689bf commit 1ecae2f

File tree

7 files changed

+37
-18
lines changed

7 files changed

+37
-18
lines changed

.no-header.php-cs-fixer.dist.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@
3030
__DIR__ . '/admin/starter/builds',
3131
]);
3232

33-
$overrides = [];
33+
$overrides = [
34+
'ordered_class_elements' => [
35+
'order' => [
36+
'use_trait',
37+
'constant',
38+
'property',
39+
'method',
40+
],
41+
'sort_algorithm' => 'none',
42+
],
43+
];
3444

3545
$options = [
3646
'cacheFile' => 'build/.no-header.php-cs-fixer.cache',

.php-cs-fixer.dist.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@
3434
__DIR__ . '/spark',
3535
]);
3636

37-
$overrides = [];
37+
$overrides = [
38+
'ordered_class_elements' => [
39+
'order' => [
40+
'use_trait',
41+
'constant',
42+
'property',
43+
'method',
44+
],
45+
'sort_algorithm' => 'none',
46+
],
47+
];
3848

3949
$options = [
4050
'cacheFile' => 'build/.php-cs-fixer.cache',

tests/_support/Publishers/TestPublisher.php

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

1616
final class TestPublisher extends Publisher
1717
{
18-
/**
19-
* Fakes an error on the given file.
20-
*/
21-
public static function setResult(bool $result)
22-
{
23-
self::$result = $result;
24-
}
25-
2618
/**
2719
* Return value for publish()
2820
*
@@ -44,6 +36,14 @@ public static function setResult(bool $result)
4436
*/
4537
protected $destination = WRITEPATH;
4638

39+
/**
40+
* Fakes an error on the given file.
41+
*/
42+
public static function setResult(bool $result)
43+
{
44+
self::$result = $result;
45+
}
46+
4747
/**
4848
* Fakes a publish event so no files are actually copied.
4949
*/

tests/system/Cache/Handlers/FileHandlerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
final class FileHandlerTest extends AbstractHandlerTest
2121
{
2222
private static $directory = 'FileHandler';
23+
private $config;
2324

2425
private static function getKeyArray()
2526
{
@@ -30,8 +31,6 @@ private static function getKeyArray()
3031
];
3132
}
3233

33-
private $config;
34-
3534
protected function setUp(): void
3635
{
3736
parent::setUp();

tests/system/Cache/Handlers/MemcachedHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
*/
2323
final class MemcachedHandlerTest extends AbstractHandlerTest
2424
{
25+
private $config;
26+
2527
private static function getKeyArray()
2628
{
2729
return [
@@ -31,8 +33,6 @@ private static function getKeyArray()
3133
];
3234
}
3335

34-
private $config;
35-
3636
protected function setUp(): void
3737
{
3838
parent::setUp();

tests/system/Cache/Handlers/PredisHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
final class PredisHandlerTest extends AbstractHandlerTest
2323
{
24+
private $config;
25+
2426
private static function getKeyArray()
2527
{
2628
return [
@@ -30,8 +32,6 @@ private static function getKeyArray()
3032
];
3133
}
3234

33-
private $config;
34-
3535
protected function setUp(): void
3636
{
3737
parent::setUp();

tests/system/Cache/Handlers/RedisHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
final class RedisHandlerTest extends AbstractHandlerTest
2323
{
24+
private $config;
25+
2426
private static function getKeyArray()
2527
{
2628
return [
@@ -30,8 +32,6 @@ private static function getKeyArray()
3032
];
3133
}
3234

33-
private $config;
34-
3535
protected function setUp(): void
3636
{
3737
parent::setUp();

0 commit comments

Comments
 (0)