Skip to content

ComposerScriptsRemoval ​

php
final class Zairakai\LaravelDevTools\Services\ComposerScriptsRemoval

Takes 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): array

The 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
ParameterDescription
$beforeWritecalled 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

Documentation of 5.5.0 , built from 92a7387 on 5.5.0 by pipeline #3086393151 on 2026-11-18.