forked from owlchester/kanka
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlarastan.php
More file actions
28 lines (21 loc) · 731 Bytes
/
larastan.php
File metadata and controls
28 lines (21 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
declare(strict_types=1);
$packagesToInstall = [
'driftingly/rector-laravel',
'rector/rector',
'webmozart/assert',
];
composer_require(...$packagesToInstall);
$hash = md5(implode(' ', $packagesToInstall));
$rectorDir = cpx_path(".exec_cache/$hash");
$rectorConfigFile = <<<'PHP'
<?php declare(strict_types=1);
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
\RectorLaravel\Rector\ClassMethod\AddGenericReturnTypeToRelationsRector::class,
]);
PHP;
file_put_contents("$rectorDir/rector.php", $rectorConfigFile);
exec("$rectorDir/vendor/bin/rector process app --config=$rectorDir/rector.php --no-progress-bar", $output, $return_var);
echo implode("\n", $output);