Skip to content

Commit 21756f8

Browse files
authored
Use BetterReflection (#117)
Remove the concept of global whitelisted classes in favour of prefixing the class based on whether or not it is internal. A couple of additional fixes: - When no namespace is found a namespace is added ensuring no code remains in the global namespace - Fix the handling of grouped use statements: the technique applied was not working when using grouped use statements with multiple namespaces
1 parent 01e41e1 commit 21756f8

File tree

117 files changed

+5347
-2926
lines changed

Some content is hidden

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

117 files changed

+5347
-2926
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ e2e: e2e_004 e2e_005 e2e_011 e2e_013 e2e_014 e2e_015
6262

6363
e2e_004: ## Run end-to-end tests for the fixture set 004: source code case
6464
e2e_004: bin/php-scoper.phar
65-
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set004 --output-dir=../../build/set004 --force --no-config --no-interaction
65+
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set004 --output-dir=../../build/set004 --force --no-config --no-interaction --stop-on-failure
6666
composer --working-dir=build/set004 dump-autoload
6767
php -d zend.enable_gc=0 -d phar.readonly=0 $(BOX) build -c build/set004/box.json.dist
6868

@@ -71,7 +71,7 @@ e2e_004: bin/php-scoper.phar
7171

7272
e2e_005: ## Run end-to-end tests for the fixture set 005: third-party code case
7373
e2e_005: bin/php-scoper.phar fixtures/set005/vendor
74-
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set005 --output-dir=../../build/set005 --force --no-config --no-interaction
74+
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set005 --output-dir=../../build/set005 --force --no-config --no-interaction --stop-on-failure
7575
composer --working-dir=build/set005 dump-autoload
7676
php -d zend.enable_gc=0 -d phar.readonly=0 $(BOX) build -c build/set005/box.json.dist
7777

@@ -80,7 +80,7 @@ e2e_005: bin/php-scoper.phar fixtures/set005/vendor
8080

8181
e2e_011: ## Run end-to-end tests for the fixture set 011: whitelist case
8282
e2e_011: bin/php-scoper.phar fixtures/set011/vendor
83-
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set011 --output-dir=../../build/set011 --force --no-interaction
83+
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set011 --output-dir=../../build/set011 --force --no-interaction --stop-on-failure
8484
cp -R fixtures/set011/tests build/set011/
8585
composer --working-dir=build/set011 dump-autoload
8686
php -d zend.enable_gc=0 -d phar.readonly=0 $(BOX) build -c build/set011/box.json.dist
@@ -97,7 +97,7 @@ e2e_013: bin/php-scoper.phar
9797

9898
e2e_014: ## Run end-to-end tests for the fixture set 014: source code case with psr-0
9999
e2e_014: bin/php-scoper.phar
100-
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set014 --output-dir=../../build/set014 --force --no-config --no-interaction
100+
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set014 --output-dir=../../build/set014 --force --no-config --no-interaction --stop-on-failure
101101
composer --working-dir=build/set014 dump-autoload
102102
php -d zend.enable_gc=0 -d phar.readonly=0 $(BOX) build -c build/set014/box.json.dist
103103

@@ -106,7 +106,7 @@ e2e_014: bin/php-scoper.phar
106106

107107
e2e_015: ## Run end-to-end tests for the fixture set 015: third-party code case with psr-0
108108
e2e_015: bin/php-scoper.phar fixtures/set015/vendor
109-
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set015 --output-dir=../../build/set015 --force --no-config --no-interaction
109+
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set015 --output-dir=../../build/set015 --force --no-config --no-interaction --stop-on-failure
110110
composer --working-dir=build/set015 dump-autoload
111111
php -d zend.enable_gc=0 -d phar.readonly=0 $(BOX) build -c build/set015/box.json.dist
112112

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
"nikic/php-parser": "^3.0",
2424
"ocramius/package-versions": "^1.1",
2525
"padraic/phar-updater": "^1.0",
26-
"symfony/console": "^3.2|^4.0",
27-
"symfony/filesystem": "^3.2|^4.0",
28-
"symfony/finder": "^3.2|^4.0",
26+
"roave/better-reflection": "^2.0",
27+
"symfony/console": "^3.2 || ^4.0",
28+
"symfony/filesystem": "^3.2 || ^4.0",
29+
"symfony/finder": "^3.2 || ^4.0",
2930
"symfony/requirements-checker": "^1.0"
3031
},
3132
"require-dev": {

0 commit comments

Comments
 (0)