generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install
rector/rector
during first run of php artisan ray:clean
instead of requiring `rector/rector`. Signed-off-by: Mior Muhammad Zaki <[email protected]>
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace Spatie\LaravelRay\Support; | ||
|
||
use Closure; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class Composer extends \Illuminate\Support\Composer | ||
{ | ||
/** | ||
* Install the given Composer packages into the application. | ||
* | ||
* @param array<int, string> $packages | ||
* @param bool $dev | ||
* @param \Closure|\Symfony\Component\Console\Output\OutputInterface|null $output | ||
* @param string|null $composerBinary | ||
* @return bool | ||
*/ | ||
public function requirePackages(array $packages, bool $dev = false, Closure|OutputInterface|null $output = null, $composerBinary = null) | ||
{ | ||
$command = collect([ | ||
...$this->findComposer($composerBinary), | ||
'require', | ||
...$packages, | ||
]) | ||
->when($dev, function ($command) { | ||
$command->push('--dev'); | ||
})->all(); | ||
|
||
return 0 === $this->getProcess($command, ['COMPOSER_MEMORY_LIMIT' => '-1']) | ||
->run( | ||
$output instanceof OutputInterface | ||
? function ($type, $line) use ($output) { | ||
$output->write(' '.$line); | ||
} : $output | ||
); | ||
} | ||
} |