php.star¶
Bump Composer package constraints and the PHP version in composer.json.
Edits keep composer.json's key order and indentation. composer.lock isn't
re-resolved; follow with a run step such as composer update <package>
--no-install --no-scripts when the lockfile is committed.
| Function | What it does |
|---|---|
manifests |
Lists the repo's composer.json files. |
set_require |
Sets a package's constraint wherever require or require-dev lists it. |
set_php |
Sets the PHP version a project requires, and optionally its config.platform.php. |
manifests¶
Lists the repo's composer.json files.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted paths of every composer.json outside vendor directories.
Example
set_require¶
Sets a package's constraint wherever require or require-dev lists it.
A newer version already there is kept, so a campaign never lowers one.
Packages a manifest doesn't require are left alone.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
package |
The package, such as laravel/framework. |
constraint |
The new constraint, such as ^11.0. |
Returns: The list of paths that changed.
Example
Used in: php-laravel-11
set_php¶
Sets the PHP version a project requires, and optionally its config.platform.php.
A newer version already there is kept, so a campaign never lowers one.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
constraint |
The require.php constraint, such as ^8.2. |
platform |
The PHP version Composer resolves against, such as 8.2.0; set only where config.platform.php already exists. |
Returns: The list of paths that changed.
Example
Used in: php-laravel-11