build prefixed rector

This commit is contained in:
mssimi 2018-04-29 18:08:42 +02:00 committed by Tomas Votruba
parent e3f6f9ca89
commit f8fc252c02
5 changed files with 55 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,4 +3,5 @@
!/temp/.gitkeep
/example
/vendor
/build
composer.lock

View File

@ -59,7 +59,18 @@
"bin/clean_levels.sh"
],
"phpstan": "vendor/bin/phpstan.phar analyse packages src tests --level max --configuration phpstan.neon",
"update-docs": "bin/rector describe --level all --format md > docs/AllRectorsOverview.md"
"update-docs": "bin/rector describe --level all --format md > docs/AllRectorsOverview.md",
"prefix-rector": [
"rm -rf build/",
"php php-scoper.phar add-prefix --no-interaction --prefix='RectorPrefixed'",
"find build/ -type f -name '*.yml' | xargs perl -pi -e 's/((?:\\\\{1,2}\\w+|\\w+\\\\{1,2})(?:\\w+\\\\{0,2})+)/RectorPrefixed\\\\\\1/g'",
"find build/ -type f | xargs sed -i 's/RectorPrefixed\\\\Rector/Rector/g'",
"find build/ -type f | xargs sed -i 's/RectorPrefixed\\\\\\\\Rector/Rector/g'",
"find build/ -type f | xargs sed -i 's/use Symfony/use RectorPrefixed\\\\\\\\Symfony/g'",
"cp composer.json build/composer.json",
"cd build && composer dump-autoload",
"cd build && php bin/rector"
]
},
"bin": [
"bin/rector",

BIN
php-scoper.phar Normal file

Binary file not shown.

14
php-scoper.phar.pubkey Normal file
View File

@ -0,0 +1,14 @@
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxKi/ABhiCMn7hqH9/W0x
v2WKZDtUTDoSFRMl3WMBRL0wEmwvEajOJkzgAZLLomg6DCGrH7dSgZXBaxWyq1yY
efw1qj9HcFlRs82Y8OfzdDRGDbRobERXH+sulukN0Su7jADOJHyILlQgc64Zql2J
+BXQbBXJGIeoVk3I1hKg6GALpoA5kfFMw3l8FztKiRFcBMSRdeFQJlcsB/FCXnfN
LJMnaB2LJnnV6eTj4xD3dXrKky8KxBKMxrryxNFcXqMMfL5gBdaU6CH4VUn5yPDs
R/1KBsCgTmnFY6QmRlp+kI1ogmS5Eqk66xs5WBmuCHeB+phP7CFwvfF4kFGIGITl
5nKMJ7GJWG9CFEbPlZAcfgK3e12NyHuX+XUoc94IxbfzvcWxC/ZiuFSOAbTG95ut
Ue51KkeIxq0GmW8djFySSJM4PZbPHtr7b2LhkJzjQ66dXWyTJjqxZRskmKQota6o
qe8YWALClKLaG+LYM7ZFC4Q6fb4gs1x05feucbmuiWboeJyfL/CmoafnB6MqYXxX
DXXJhMWYbrTZuawNXUe/WhEQIdiGJsoI61y7DgvKw6ExdnelIakAO9EOfkffY5wE
KVZf+2kuEqm5UPvKmwozp/g/WmMAEEn6OJbHxeqKX7Ds/eLFiE2WlZm1YO3/JNbF
HshwDz0FnMzwQom3CiykuOsCAwEAAQ==
-----END PUBLIC KEY-----

28
scoper.inc.php Normal file
View File

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
use Isolated\Symfony\Component\Finder\Finder;
return [
'prefix' => 'RectorPrefixed',
'finders' => [
Finder::create()
->files()
->ignoreVCS(true)
->notName('/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/')
->in('*')
->exclude([
'docs',
'Tests'
])
,
],
'patchers' => [
function (string $filePath, string $prefix, string $contents): string {
// Change the contents here.
return $contents;
},
],
];