Skip to content

Commit cb714b5

Browse files
authored
Change behavior of class_attributes_separation rule
1 parent 817c099 commit cb714b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+161
-265
lines changed

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,22 @@
3030
$overrides = [
3131
// @TODO Remove once these are live in coding-standard
3232
'assign_null_coalescing_to_coalesce_equal' => false, // requires 7.4+
33-
'control_structure_continuation_position' => ['position' => 'same_line'],
34-
'empty_loop_condition' => ['style' => 'while'],
35-
'integer_literal_case' => true,
36-
'modernize_strpos' => false, // requires 8.0+
37-
'no_alternative_syntax' => ['fix_non_monolithic_code' => false],
38-
'no_space_around_double_colon' => true,
39-
'octal_notation' => false, // requires 8.1+
40-
'string_length_to_empty' => true,
33+
'class_attributes_separation' => [
34+
'elements' => [
35+
'const' => 'none',
36+
'property' => 'none',
37+
'method' => 'one',
38+
'trait_import' => 'none',
39+
],
40+
],
41+
'control_structure_continuation_position' => ['position' => 'same_line'],
42+
'empty_loop_condition' => ['style' => 'while'],
43+
'integer_literal_case' => true,
44+
'modernize_strpos' => false, // requires 8.0+
45+
'no_alternative_syntax' => ['fix_non_monolithic_code' => false],
46+
'no_space_around_double_colon' => true,
47+
'octal_notation' => false, // requires 8.1+
48+
'string_length_to_empty' => true,
4149
];
4250

4351
$options = [

.php-cs-fixer.dist.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,22 @@
3737
$overrides = [
3838
// @TODO Remove once these are live in coding-standard
3939
'assign_null_coalescing_to_coalesce_equal' => false, // requires 7.4+
40-
'control_structure_continuation_position' => ['position' => 'same_line'],
41-
'empty_loop_condition' => ['style' => 'while'],
42-
'integer_literal_case' => true,
43-
'modernize_strpos' => false, // requires 8.0+
44-
'no_alternative_syntax' => ['fix_non_monolithic_code' => false],
45-
'no_space_around_double_colon' => true,
46-
'octal_notation' => false, // requires 8.1+
47-
'string_length_to_empty' => true,
40+
'class_attributes_separation' => [
41+
'elements' => [
42+
'const' => 'none',
43+
'property' => 'none',
44+
'method' => 'one',
45+
'trait_import' => 'none',
46+
],
47+
],
48+
'control_structure_continuation_position' => ['position' => 'same_line'],
49+
'empty_loop_condition' => ['style' => 'while'],
50+
'integer_literal_case' => true,
51+
'modernize_strpos' => false, // requires 8.0+
52+
'no_alternative_syntax' => ['fix_non_monolithic_code' => false],
53+
'no_space_around_double_colon' => true,
54+
'octal_notation' => false, // requires 8.1+
55+
'string_length_to_empty' => true,
4856
];
4957

5058
$options = [

admin/module/tests/_support/Models/ExampleModel.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@
66

77
class ExampleModel extends Model
88
{
9-
protected $table = 'factories';
10-
protected $primaryKey = 'id';
11-
9+
protected $table = 'factories';
10+
protected $primaryKey = 'id';
1211
protected $returnType = 'object';
1312
protected $useSoftDeletes = false;
14-
15-
protected $allowedFields = [
13+
protected $allowedFields = [
1614
'name',
1715
'uid',
1816
'class',
1917
'icon',
2018
'summary',
2119
];
22-
23-
protected $useTimestamps = true;
24-
20+
protected $useTimestamps = true;
2521
protected $validationRules = [];
2622
protected $validationMessages = [];
2723
protected $skipValidation = false;

admin/starter/tests/_support/Models/ExampleModel.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@
66

77
class ExampleModel extends Model
88
{
9-
protected $table = 'factories';
10-
protected $primaryKey = 'id';
11-
9+
protected $table = 'factories';
10+
protected $primaryKey = 'id';
1211
protected $returnType = 'object';
1312
protected $useSoftDeletes = false;
14-
15-
protected $allowedFields = [
13+
protected $allowedFields = [
1614
'name',
1715
'uid',
1816
'class',
1917
'icon',
2018
'summary',
2119
];
22-
23-
protected $useTimestamps = true;
24-
20+
protected $useTimestamps = true;
2521
protected $validationRules = [];
2622
protected $validationMessages = [];
2723
protected $skipValidation = false;

app/Config/Kint.php

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,28 @@ class Kint extends BaseConfig
2424
*/
2525

2626
public $plugins;
27-
28-
public $maxDepth = 6;
29-
27+
public $maxDepth = 6;
3028
public $displayCalledFrom = true;
31-
32-
public $expanded = false;
29+
public $expanded = false;
3330

3431
/*
3532
|--------------------------------------------------------------------------
3633
| RichRenderer Settings
3734
|--------------------------------------------------------------------------
3835
*/
39-
public $richTheme = 'aante-light.css';
40-
36+
public $richTheme = 'aante-light.css';
4137
public $richFolder = false;
42-
43-
public $richSort = Renderer::SORT_FULL;
44-
38+
public $richSort = Renderer::SORT_FULL;
4539
public $richObjectPlugins;
46-
4740
public $richTabPlugins;
4841

4942
/*
5043
|--------------------------------------------------------------------------
5144
| CLI Settings
5245
|--------------------------------------------------------------------------
5346
*/
54-
public $cliColors = true;
55-
56-
public $cliForceUTF8 = false;
57-
47+
public $cliColors = true;
48+
public $cliForceUTF8 = false;
5849
public $cliDetectWidth = true;
59-
60-
public $cliMinWidth = 40;
50+
public $cliMinWidth = 40;
6151
}

system/Test/Mock/MockAppConfig.php

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,25 @@
1515

1616
class MockAppConfig extends App
1717
{
18-
public $baseURL = 'http://example.com/';
19-
20-
public $uriProtocol = 'REQUEST_URI';
21-
22-
public $cookiePrefix = '';
23-
public $cookieDomain = '';
24-
public $cookiePath = '/';
25-
public $cookieSecure = false;
26-
public $cookieHTTPOnly = false;
27-
public $cookieSameSite = 'Lax';
28-
29-
public $proxyIPs = '';
30-
31-
public $CSRFProtection = false;
32-
public $CSRFTokenName = 'csrf_test_name';
33-
public $CSRFHeaderName = 'X-CSRF-TOKEN';
34-
public $CSRFCookieName = 'csrf_cookie_name';
35-
public $CSRFExpire = 7200;
36-
public $CSRFRegenerate = true;
37-
public $CSRFExcludeURIs = ['http://example.com'];
38-
public $CSRFRedirect = false;
39-
public $CSRFSameSite = 'Lax';
40-
41-
public $CSPEnabled = false;
42-
18+
public $baseURL = 'http://example.com/';
19+
public $uriProtocol = 'REQUEST_URI';
20+
public $cookiePrefix = '';
21+
public $cookieDomain = '';
22+
public $cookiePath = '/';
23+
public $cookieSecure = false;
24+
public $cookieHTTPOnly = false;
25+
public $cookieSameSite = 'Lax';
26+
public $proxyIPs = '';
27+
public $CSRFProtection = false;
28+
public $CSRFTokenName = 'csrf_test_name';
29+
public $CSRFHeaderName = 'X-CSRF-TOKEN';
30+
public $CSRFCookieName = 'csrf_cookie_name';
31+
public $CSRFExpire = 7200;
32+
public $CSRFRegenerate = true;
33+
public $CSRFExcludeURIs = ['http://example.com'];
34+
public $CSRFRedirect = false;
35+
public $CSRFSameSite = 'Lax';
36+
public $CSPEnabled = false;
4337
public $defaultLocale = 'en';
4438
public $negotiateLocale = false;
4539
public $supportedLocales = [

system/Test/Mock/MockAutoload.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
class MockAutoload extends Autoload
1717
{
18-
public $psr4 = [];
19-
18+
public $psr4 = [];
2019
public $classmap = [];
2120

2221
public function __construct()

system/Test/Mock/MockCLIConfig.php

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,23 @@
1515

1616
class MockCLIConfig extends App
1717
{
18-
public $baseURL = 'http://example.com/';
19-
20-
public $uriProtocol = 'REQUEST_URI';
21-
22-
public $cookiePrefix = '';
23-
public $cookieDomain = '';
24-
public $cookiePath = '/';
25-
public $cookieSecure = false;
26-
public $cookieHTTPOnly = false;
27-
public $cookieSameSite = 'Lax';
28-
29-
public $proxyIPs = '';
30-
31-
public $CSRFProtection = false;
32-
public $CSRFTokenName = 'csrf_test_name';
33-
public $CSRFCookieName = 'csrf_cookie_name';
34-
public $CSRFExpire = 7200;
35-
public $CSRFRegenerate = true;
36-
public $CSRFExcludeURIs = ['http://example.com'];
37-
public $CSRFSameSite = 'Lax';
38-
39-
public $CSPEnabled = false;
40-
18+
public $baseURL = 'http://example.com/';
19+
public $uriProtocol = 'REQUEST_URI';
20+
public $cookiePrefix = '';
21+
public $cookieDomain = '';
22+
public $cookiePath = '/';
23+
public $cookieSecure = false;
24+
public $cookieHTTPOnly = false;
25+
public $cookieSameSite = 'Lax';
26+
public $proxyIPs = '';
27+
public $CSRFProtection = false;
28+
public $CSRFTokenName = 'csrf_test_name';
29+
public $CSRFCookieName = 'csrf_cookie_name';
30+
public $CSRFExpire = 7200;
31+
public $CSRFRegenerate = true;
32+
public $CSRFExcludeURIs = ['http://example.com'];
33+
public $CSRFSameSite = 'Lax';
34+
public $CSPEnabled = false;
4135
public $defaultLocale = 'en';
4236
public $negotiateLocale = false;
4337
public $supportedLocales = [

system/Test/Mock/MockCURLRequest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
class MockCURLRequest extends CURLRequest
2424
{
2525
public $curl_options;
26-
2726
protected $output = '';
2827

2928
public function setOutput($output)

system/Test/Mock/MockConnection.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
class MockConnection extends BaseConnection
2020
{
2121
protected $returnValues = [];
22-
2322
public $database;
24-
2523
public $lastQuery;
2624

2725
public function shouldReturn(string $method, $return)

system/Test/Mock/MockServices.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class MockServices extends BaseService
1919
public $psr4 = [
2020
'Tests/Support' => TESTPATH . '_support/',
2121
];
22-
2322
public $classmap = [];
2423

2524
public function __construct()

tests/_support/Models/EntityModel.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515

1616
class EntityModel extends Model
1717
{
18-
protected $table = 'job';
19-
20-
protected $returnType = '\Tests\Support\Models\SimpleEntity';
21-
18+
protected $table = 'job';
19+
protected $returnType = '\Tests\Support\Models\SimpleEntity';
2220
protected $useSoftDeletes = false;
23-
24-
protected $dateFormat = 'int';
25-
26-
protected $deletedField = 'deleted_at';
27-
28-
protected $allowedFields = [
21+
protected $dateFormat = 'int';
22+
protected $deletedField = 'deleted_at';
23+
protected $allowedFields = [
2924
'name',
3025
'description',
3126
'created_at',

tests/_support/Models/EventModel.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,16 @@
1515

1616
class EventModel extends Model
1717
{
18-
protected $table = 'user';
19-
20-
protected $returnType = 'array';
21-
18+
protected $table = 'user';
19+
protected $returnType = 'array';
2220
protected $useSoftDeletes = false;
23-
24-
protected $dateFormat = 'datetime';
25-
26-
protected $allowedFields = [
21+
protected $dateFormat = 'datetime';
22+
protected $allowedFields = [
2723
'name',
2824
'email',
2925
'country',
3026
'deleted_at',
3127
];
32-
3328
protected $beforeInsert = ['beforeInsertMethod'];
3429
protected $afterInsert = ['afterInsertMethod'];
3530
protected $beforeUpdate = ['beforeUpdateMethod'];

tests/_support/Models/FabricatorModel.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@
1616

1717
class FabricatorModel extends Model
1818
{
19-
protected $table = 'job';
20-
21-
protected $returnType = 'object';
22-
19+
protected $table = 'job';
20+
protected $returnType = 'object';
2321
protected $useSoftDeletes = true;
24-
25-
protected $useTimestamps = true;
26-
27-
protected $dateFormat = 'int';
28-
29-
protected $allowedFields = [
22+
protected $useTimestamps = true;
23+
protected $dateFormat = 'int';
24+
protected $allowedFields = [
3025
'name',
3126
'description',
3227
];

tests/_support/Models/JobModel.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@
1515

1616
class JobModel extends Model
1717
{
18-
protected $table = 'job';
19-
20-
protected $returnType = 'object';
21-
18+
protected $table = 'job';
19+
protected $returnType = 'object';
2220
protected $useSoftDeletes = false;
23-
24-
protected $dateFormat = 'int';
25-
26-
protected $allowedFields = [
21+
protected $dateFormat = 'int';
22+
protected $allowedFields = [
2723
'name',
2824
'description',
2925
];
30-
31-
public $name = '';
32-
26+
public $name = '';
3327
public $description = '';
3428
}

0 commit comments

Comments
 (0)