Skip to content

Commit

Permalink
Remove usages of 'spec' in the specifications (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Jul 22, 2018
1 parent bc3061c commit 56adc81
Show file tree
Hide file tree
Showing 78 changed files with 459 additions and 2,178 deletions.
4 changes: 2 additions & 2 deletions specs/binary/simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'whitelist-global-functions' => true,
],

'some statements made directly in the global namespace: wrap them in a namespace statement' => <<<'PHP'
'Some statements made directly in the global namespace' => <<<'PHP'
<?php declare(strict_types=1);
/*
Expand Down Expand Up @@ -66,7 +66,7 @@
PHP
,

'some statements made directly in the global namespace with a shebang: wrap them in a namespace statement' => <<<'PHP'
'Some statements made directly in the global namespace with a shebang' => <<<'PHP'
#!/usr/bin/env php
<?php declare(strict_types=1);
Expand Down
30 changes: 4 additions & 26 deletions specs/class-FQ.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@
'whitelist-global-functions' => true,
],

[
'spec' => <<<'SPEC'
Different kind of whitelisted class constant calls in the global scope:
- prefix the whitelisted classes and append their class aliases
- transforms the call into a FQ
- resolve the aliases
SPEC
,
'Different kind of whitelisted class constant calls in the global scope' => [
'whitelist' => ['Foo\Bar', 'Foo\Bar\Poz'],
'payload' => <<<'PHP'
<?php
Expand Down Expand Up @@ -105,15 +98,7 @@ class Poz
PHP
],

[
'spec' => <<<'SPEC'
Different kind of class constant calls in the global scope:
- prefix the whitelisted classes and append their class aliases
- transforms the call into a FQ
- resolve the aliases
SPEC
,
'payload' => <<<'PHP'
'Different kind of class constant calls in the global scope' => <<<'PHP'
<?php
namespace {
Expand Down Expand Up @@ -182,16 +167,9 @@ class Poz
\Humbug\Foo\Bar\Poz::MAIN_CONST;

PHP
],
,

[
'spec' => <<<'SPEC'
Different kind of class constant calls in a namespace:
- prefix the whitelisted classes and append their class aliases
- transforms the call into a FQ
- resolve the aliases
SPEC
,
'Different kind of class constant calls in a namespace' => [
'whitelist' => [
'Foo\Bar',
'Foo\Bar\Poz',
Expand Down
2 changes: 1 addition & 1 deletion specs/class-const/global-scope-single-level.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Command
PHP
],

'Constant call on a class belonging to the global namespace which is whitelisted: add root namespace statement' => [
'Constant call on a class belonging to the global namespace which is whitelisted' => [
'whitelist' => ['\*'],
'payload' => <<<'PHP'
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@
'whitelist-global-functions' => true,
],

[
'spec' => <<<'SPEC'
Constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace:
- prefix the use statement (cf. class belonging to the global scope tests)
- prefix the constant
SPEC
,
'payload' => <<<'PHP'
'Constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace' => <<<'PHP'
<?php
class Foo {}
Expand All @@ -49,16 +42,9 @@ class Foo
\Humbug\Foo::$mainStaticProp;

PHP
],
,

[
'spec' => <<<'SPEC'
FQ constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace:
- do not prefix the class (cf. class belonging to the global scope tests)
- do nothing
SPEC
,
'payload' => <<<'PHP'
'FQ constant call on a aliased class which is imported via an aliased use statement and which belongs to the global namespace' => <<<'PHP'
<?php
class Foo {}
Expand All @@ -82,16 +68,9 @@ class X
\Humbug\X::$mainStaticProp;

PHP
],
,

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

PHP
],
,

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

PHP
],
,
];
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@
'whitelist-global-functions' => true,
],

[
'spec' => <<<'SPEC'
Constant call on a class which is imported via a use statement and which belongs to the global namespace:
- do not prefix the use statement (cf. class belonging to the global scope tests)
- transforms the call into a FQ call
SPEC
,
'payload' => <<<'PHP'
'Constant call on a class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
<?php
class Command {}
Expand All @@ -49,16 +42,9 @@ class Command
\Humbug\Command::$mainStaticProp;

PHP
],
,

[
'spec' => <<<'SPEC'
FQ constant call on a class which is imported via a use statement and which belongs to the global namespace:
- do not prefix the use statement (cf. class belonging to the global scope tests)
- do nothing
SPEC
,
'payload' => <<<'PHP'
'FQ constant call on a class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
<?php
class Command {}
Expand All @@ -78,16 +64,9 @@ class Command
\Humbug\Command::$mainStaticProp;

PHP
],

[
'spec' => <<<'SPEC'
Constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace:
- transform the call in a FQ call (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in
global whitelisted classes)
SPEC
,
'payload' => <<<'PHP'

'Constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
<?php
use Reflector;
Expand All @@ -102,16 +81,9 @@ class Command
\Reflector::$mainStaticProp;

PHP
],
,

[
'spec' => <<<'SPEC'
FQ constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace:
- prefix the class (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global
whitelisted classes)
SPEC
,
'payload' => <<<'PHP'
'FQ constant call on a whitelisted class which is imported via a use statement and which belongs to the global namespace' => <<<'PHP'
<?php
use Reflector;
Expand All @@ -126,5 +98,5 @@ class Command
\Reflector::$mainStaticProp;

PHP
],
,
];
46 changes: 9 additions & 37 deletions specs/class-static-prop/global-scope-single-level.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@
'whitelist-global-functions' => true,
],

[
'spec' => <<<'SPEC'
Constant call on a class belonging to the global namespace:
- do not prefix the class (cf. class belonging to the global scope tests)
- transforms the call into a FQ call to avoid autoloading issues
SPEC
,
'payload' => <<<'PHP'
'Constant call on a class belonging to the global namespace' => <<<'PHP'
<?php
class Command {}
Expand All @@ -46,9 +39,9 @@ class Command
\Humbug\Command::$mainStaticProp;

PHP
],
,

'Constant call on a class belonging to the global namespace which is whitelisted: add root namespace statement' => [
'Constant call on a class belonging to the global namespace which is whitelisted' => [
'whitelist' => ['\*'],
'payload' => <<<'PHP'
<?php
Expand All @@ -69,14 +62,7 @@ class Command
PHP
],

[
'spec' => <<<'SPEC'
FQ constant call on a class belonging to the global namespace:
- do not prefix the class (cf. class belonging to the global scope tests)
- do not touch the call
SPEC
,
'payload' => <<<'PHP'
'FQ constant call on a class belonging to the global namespace' => <<<'PHP'
<?php
class Command {}
Expand All @@ -93,16 +79,9 @@ class Command
\Humbug\Command::$mainStaticProp;

PHP
],
,

[
'spec' => <<<'SPEC'
Constant call on a whitelisted class belonging to the global namespace:
- prefix the class (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global whitelisted classes)
- transforms the call into a FQ call to avoid autoloading issues
SPEC
,
'payload' => <<<'PHP'
'Constant call on a whitelisted class belonging to the global namespace' => <<<'PHP'
<?php
Reflector::$mainStaticProp;
Expand All @@ -114,16 +93,9 @@ class Command
\Reflector::$mainStaticProp;

PHP
],
,

[
'spec' => <<<'SPEC'
FQ constant call on a whitelisted class belonging to the global namespace:
- prefix the class (cf. class belonging to the global scope tests and `scope.inc.php` for the built-in global whitelisted classes)
- transforms the call into a FQ call to avoid autoloading issues
SPEC
,
'payload' => <<<'PHP'
'FQ constant call on a whitelisted class belonging to the global namespace' => <<<'PHP'
<?php
\Reflector::$mainStaticProp;
Expand All @@ -135,5 +107,5 @@ class Command
\Reflector::$mainStaticProp;

PHP
],
,
];
Loading

0 comments on commit 56adc81

Please sign in to comment.