Appearance
ComposerScriptsRemoval
php
final class Zairakai\LaravelDevTools\Services\ComposerScriptsRemovalTakes the Composer scripts of the package out of the composer.json of a project: the ones that still equal the scripts of the package. A script that the project changed is its own.
Source: src/Services/ComposerScriptsRemoval.php
Methods
removable()
php
public static function removable(string $composerJsonPath, string $stubPath): arrayThe scripts of the project that equal the ones of the package.
Returns list<string>
Throws RuntimeException when composer.json or the stub is missing or cannot be read
remove()
php
public static function remove(string $composerJsonPath, string $stubPath, callable $beforeWrite = null): array| Parameter | Description |
|---|---|
$beforeWrite | called with the path of composer.json, before it is written over |
Returns list<string> the names of the scripts removed
Throws RuntimeException when composer.json or the stub is missing or cannot be read