mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-22 16:32:27 +02:00
build prefixed rector
This commit is contained in:
parent
e3f6f9ca89
commit
f8fc252c02
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,4 +3,5 @@
|
||||
!/temp/.gitkeep
|
||||
/example
|
||||
/vendor
|
||||
/build
|
||||
composer.lock
|
||||
|
@ -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
BIN
php-scoper.phar
Normal file
Binary file not shown.
14
php-scoper.phar.pubkey
Normal file
14
php-scoper.phar.pubkey
Normal 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
28
scoper.inc.php
Normal 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;
|
||||
},
|
||||
],
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user