Skip to content

Commit 56adc81

Browse files
authored
Remove usages of 'spec' in the specifications (#249)
1 parent bc3061c commit 56adc81

File tree

78 files changed

+459
-2178
lines changed

Some content is hidden

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

78 files changed

+459
-2178
lines changed

specs/binary/simple.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'whitelist-global-functions' => true,
2323
],
2424

25-
'some statements made directly in the global namespace: wrap them in a namespace statement' => <<<'PHP'
25+
'Some statements made directly in the global namespace' => <<<'PHP'
2626
<?php declare(strict_types=1);
2727
2828
/*
@@ -66,7 +66,7 @@
6666
PHP
6767
,
6868

69-
'some statements made directly in the global namespace with a shebang: wrap them in a namespace statement' => <<<'PHP'
69+
'Some statements made directly in the global namespace with a shebang' => <<<'PHP'
7070
#!/usr/bin/env php
7171
<?php declare(strict_types=1);
7272

specs/class-FQ.php

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@
2222
'whitelist-global-functions' => true,
2323
],
2424

25-
[
26-
'spec' => <<<'SPEC'
27-
Different kind of whitelisted class constant calls in the global scope:
28-
- prefix the whitelisted classes and append their class aliases
29-
- transforms the call into a FQ
30-
- resolve the aliases
31-
SPEC
32-
,
25+
'Different kind of whitelisted class constant calls in the global scope' => [
3326
'whitelist' => ['Foo\Bar', 'Foo\Bar\Poz'],
3427
'payload' => <<<'PHP'
3528
<?php
@@ -105,15 +98,7 @@ class Poz
10598
PHP
10699
],
107100

108-
[
109-
'spec' => <<<'SPEC'
110-
Different kind of class constant calls in the global scope:
111-
- prefix the whitelisted classes and append their class aliases
112-
- transforms the call into a FQ
113-
- resolve the aliases
114-
SPEC
115-
,
116-
'payload' => <<<'PHP'
101+
'Different kind of class constant calls in the global scope' => <<<'PHP'
117102
<?php
118103
119104
namespace {
@@ -182,16 +167,9 @@ class Poz
182167
\Humbug\Foo\Bar\Poz::MAIN_CONST;
183168

184169
PHP
185-
],
170+
,
186171

187-
[
188-
'spec' => <<<'SPEC'
189-
Different kind of class constant calls in a namespace:
190-
- prefix the whitelisted classes and append their class aliases
191-
- transforms the call into a FQ
192-
- resolve the aliases
193-
SPEC
194-
,
172+
'Different kind of class constant calls in a namespace' => [
195173
'whitelist' => [
196174
'Foo\Bar',
197175
'Foo\Bar\Poz',

specs/class-const/global-scope-single-level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Command
4242
PHP
4343
],
4444

45-
'Constant call on a class belonging to the global namespace which is whitelisted: add root namespace statement' => [
45+
'Constant call on a class belonging to the global namespace which is whitelisted' => [
4646
'whitelist' => ['\*'],
4747
'payload' => <<<'PHP'
4848
<?php

specs/class-static-prop/global-scope-single-level-with-single-level-use-statement-and-alias.php

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@
2222
'whitelist-global-functions' => true,
2323
],
2424

25-
[
26-
'spec' => <<<'SPEC'
27-
Constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace:
28-
- prefix the use statement (cf. class belonging to the global scope tests)
29-
- prefix the constant
30-
SPEC
31-
,
32-
'payload' => <<<'PHP'
25+
'Constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace' => <<<'PHP'
3326
<?php
3427
3528
class Foo {}
@@ -49,16 +42,9 @@ class Foo
4942
\Humbug\Foo::$mainStaticProp;
5043

5144
PHP
52-
],
45+
,
5346

54-
[
55-
'spec' => <<<'SPEC'
56-
FQ constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace:
57-
- do not prefix the class (cf. class belonging to the global scope tests)
58-
- do nothing
59-
SPEC
60-
,
61-
'payload' => <<<'PHP'
47+
'FQ constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace' => <<<'PHP'
6248
<?php
6349
6450
class Foo {}
@@ -82,16 +68,9 @@ class X
8268
\Humbug\X::$mainStaticProp;
8369

8470
PHP
85-
],
71+
,
8672

87-
[
88-
'spec' => <<<'SPEC'
89-
Constant call on a whitelisted class which is imported via an aliased use statement and which belongs to the global namespace:
90-
- prefix the use statement (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global whitelisted classes)
91-
- transform the call into a FQ call
92-
SPEC
93-
,
94-
'payload' => <<<'PHP'
73+
'Constant call on a whitelisted class which is imported via an aliased use statement and which belongs to the global namespace' => <<<'PHP'
9574
<?php
9675
9776
use Reflector as X;
@@ -106,16 +85,9 @@ class X
10685
\Reflector::$mainStaticProp;
10786

10887
PHP
109-
],
88+
,
11089

111-
[
112-
'spec' => <<<'SPEC'
113-
FQ constant call on a whitelisted class which is imported via an aliased use statement and which belongs to the global namespace:
114-
- prefix the use statement (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global whitelisted classes)
115-
- do nothing
116-
SPEC
117-
,
118-
'payload' => <<<'PHP'
90+
'FQ constant call on a whitelisted class which is imported via an aliased use statement and which belongs to the global namespace' => <<<'PHP'
11991
<?php
12092
12193
class X {}
@@ -135,5 +107,5 @@ class X
135107
\Humbug\X::$mainStaticProp;
136108

137109
PHP
138-
],
110+
,
139111
];

specs/class-static-prop/global-scope-single-level-with-single-level-use-statement.php

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@
2222
'whitelist-global-functions' => true,
2323
],
2424

25-
[
26-
'spec' => <<<'SPEC'
27-
Constant call on a class which is imported via a use statement and which belongs to the global namespace:
28-
- do not prefix the use statement (cf. class belonging to the global scope tests)
29-
- transforms the call into a FQ call
30-
SPEC
31-
,
32-
'payload' => <<<'PHP'
25+
'Constant call on a class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
3326
<?php
3427
3528
class Command {}
@@ -49,16 +42,9 @@ class Command
4942
\Humbug\Command::$mainStaticProp;
5043

5144
PHP
52-
],
45+
,
5346

54-
[
55-
'spec' => <<<'SPEC'
56-
FQ constant call on a class which is imported via a use statement and which belongs to the global namespace:
57-
- do not prefix the use statement (cf. class belonging to the global scope tests)
58-
- do nothing
59-
SPEC
60-
,
61-
'payload' => <<<'PHP'
47+
'FQ constant call on a class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
6248
<?php
6349
6450
class Command {}
@@ -78,16 +64,9 @@ class Command
7864
\Humbug\Command::$mainStaticProp;
7965

8066
PHP
81-
],
82-
83-
[
84-
'spec' => <<<'SPEC'
85-
Constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace:
86-
- transform the call in a FQ call (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in
87-
global whitelisted classes)
88-
SPEC
8967
,
90-
'payload' => <<<'PHP'
68+
69+
'Constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
9170
<?php
9271
9372
use Reflector;
@@ -102,16 +81,9 @@ class Command
10281
\Reflector::$mainStaticProp;
10382

10483
PHP
105-
],
84+
,
10685

107-
[
108-
'spec' => <<<'SPEC'
109-
FQ constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace:
110-
- prefix the class (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global
111-
whitelisted classes)
112-
SPEC
113-
,
114-
'payload' => <<<'PHP'
86+
'FQ constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
11587
<?php
11688
11789
use Reflector;
@@ -126,5 +98,5 @@ class Command
12698
\Reflector::$mainStaticProp;
12799

128100
PHP
129-
],
101+
,
130102
];

specs/class-static-prop/global-scope-single-level.php

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@
2222
'whitelist-global-functions' => true,
2323
],
2424

25-
[
26-
'spec' => <<<'SPEC'
27-
Constant call on a class belonging to the global namespace:
28-
- do not prefix the class (cf. class belonging to the global scope tests)
29-
- transforms the call into a FQ call to avoid autoloading issues
30-
SPEC
31-
,
32-
'payload' => <<<'PHP'
25+
'Constant call on a class belonging to the global namespace' => <<<'PHP'
3326
<?php
3427
3528
class Command {}
@@ -46,9 +39,9 @@ class Command
4639
\Humbug\Command::$mainStaticProp;
4740

4841
PHP
49-
],
42+
,
5043

51-
'Constant call on a class belonging to the global namespace which is whitelisted: add root namespace statement' => [
44+
'Constant call on a class belonging to the global namespace which is whitelisted' => [
5245
'whitelist' => ['\*'],
5346
'payload' => <<<'PHP'
5447
<?php
@@ -69,14 +62,7 @@ class Command
6962
PHP
7063
],
7164

72-
[
73-
'spec' => <<<'SPEC'
74-
FQ constant call on a class belonging to the global namespace:
75-
- do not prefix the class (cf. class belonging to the global scope tests)
76-
- do not touch the call
77-
SPEC
78-
,
79-
'payload' => <<<'PHP'
65+
'FQ constant call on a class belonging to the global namespace' => <<<'PHP'
8066
<?php
8167
8268
class Command {}
@@ -93,16 +79,9 @@ class Command
9379
\Humbug\Command::$mainStaticProp;
9480

9581
PHP
96-
],
82+
,
9783

98-
[
99-
'spec' => <<<'SPEC'
100-
Constant call on a whitelisted class belonging to the global namespace:
101-
- prefix the class (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global whitelisted classes)
102-
- transforms the call into a FQ call to avoid autoloading issues
103-
SPEC
104-
,
105-
'payload' => <<<'PHP'
84+
'Constant call on a whitelisted class belonging to the global namespace' => <<<'PHP'
10685
<?php
10786
10887
Reflector::$mainStaticProp;
@@ -114,16 +93,9 @@ class Command
11493
\Reflector::$mainStaticProp;
11594

11695
PHP
117-
],
96+
,
11897

119-
[
120-
'spec' => <<<'SPEC'
121-
FQ constant call on a whitelisted class belonging to the global namespace:
122-
- prefix the class (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global whitelisted classes)
123-
- transforms the call into a FQ call to avoid autoloading issues
124-
SPEC
125-
,
126-
'payload' => <<<'PHP'
98+
'FQ constant call on a whitelisted class belonging to the global namespace' => <<<'PHP'
12799
<?php
128100
129101
\Reflector::$mainStaticProp;
@@ -135,5 +107,5 @@ class Command
135107
\Reflector::$mainStaticProp;
136108

137109
PHP
138-
],
110+
,
139111
];

0 commit comments

Comments
 (0)