Skip to content

Enable ordered_class_elements rule #5265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .no-header.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@
__DIR__ . '/admin/starter/builds',
]);

$overrides = [];
$overrides = [
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant',
'property',
'method',
],
'sort_algorithm' => 'none',
],
];

$options = [
'cacheFile' => 'build/.no-header.php-cs-fixer.cache',
Expand Down
12 changes: 11 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@
__DIR__ . '/spark',
]);

$overrides = [];
$overrides = [
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant',
'property',
'method',
],
'sort_algorithm' => 'none',
],
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
Expand Down
16 changes: 8 additions & 8 deletions tests/_support/Publishers/TestPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@

final class TestPublisher extends Publisher
{
/**
* Fakes an error on the given file.
*/
public static function setResult(bool $result)
{
self::$result = $result;
}

/**
* Return value for publish()
*
Expand All @@ -44,6 +36,14 @@ public static function setResult(bool $result)
*/
protected $destination = WRITEPATH;

/**
* Fakes an error on the given file.
*/
public static function setResult(bool $result)
{
self::$result = $result;
}

/**
* Fakes a publish event so no files are actually copied.
*/
Expand Down
3 changes: 1 addition & 2 deletions tests/system/Cache/Handlers/FileHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
final class FileHandlerTest extends AbstractHandlerTest
{
private static $directory = 'FileHandler';
private $config;

private static function getKeyArray()
{
Expand All @@ -30,8 +31,6 @@ private static function getKeyArray()
];
}

private $config;

protected function setUp(): void
{
parent::setUp();
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Cache/Handlers/MemcachedHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/
final class MemcachedHandlerTest extends AbstractHandlerTest
{
private $config;

private static function getKeyArray()
{
return [
Expand All @@ -31,8 +33,6 @@ private static function getKeyArray()
];
}

private $config;

protected function setUp(): void
{
parent::setUp();
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Cache/Handlers/PredisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
final class PredisHandlerTest extends AbstractHandlerTest
{
private $config;

private static function getKeyArray()
{
return [
Expand All @@ -30,8 +32,6 @@ private static function getKeyArray()
];
}

private $config;

protected function setUp(): void
{
parent::setUp();
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Cache/Handlers/RedisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
final class RedisHandlerTest extends AbstractHandlerTest
{
private $config;

private static function getKeyArray()
{
return [
Expand All @@ -30,8 +32,6 @@ private static function getKeyArray()
];
}

private $config;

protected function setUp(): void
{
parent::setUp();
Expand Down