Open BrianHenryIE opened 2 months ago
@BrianHenryIE Seems to work fine for me:
$ wp scaffold package rocket/info
Success: Created package files in /Users/danielbachhuber/wp-cli/packages/local/rocket/info
Success: Created package test files.
Success: Created package readme.
Success: Created package GitHub configuration.
Installing package rocket/info (dev-main || dev-master || dev-trunk)
Updating /Users/danielbachhuber/wp-cli/packages/composer.json to require the package...
Registering /Users/danielbachhuber/wp-cli/packages/local/rocket/info as a path repository...
Using Composer to install the package...
---
Loading composer repositories with package information
Built pool.
Running pool optimizer.
Updating dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.000 seconds
Analyzed 101 packages to resolve dependencies
Analyzed 102 rules to resolve dependencies
Lock file operations: 1 install, 0 updates, 0 removals
Installs: rocket/info:dev-main
- Locking rocket/info (dev-main)
Writing lock file
Installing dependencies from lock file
Package operations: 1 install, 0 updates, 0 removals
Installs: rocket/info:dev-main
- Installing <info>rocket/info</info> (<comment>dev-main</comment>)
Generating autoload files
No security vulnerability advisories found.
---
Success: Package installed.
I'm not sure how ReactPHP was added to the mix?
I tested on another machine just now and had the same problem. Looks like the root is Composer itself requiring react/promise
.
cat ~/.wp-cli/packages/composer.lock
..
{
"name": "composer/composer",
"version": "2.8.1",
"source": {
"type": "git",
"url": "https://github.com/composer/composer.git",
"reference": "e52b8672276cf436670cdd6bd5de4353740e83b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/composer/zipball/e52b8672276cf436670cdd6bd5de4353740e83b2",
"reference": "e52b8672276cf436670cdd6bd5de4353740e83b2",
"shasum": ""
},
"require": {
"composer/ca-bundle": "^1.5",
"composer/class-map-generator": "^1.4.0",
"composer/metadata-minifier": "^1.0",
"composer/pcre": "^2.2 || ^3.2",
"composer/semver": "^3.3",
"composer/spdx-licenses": "^1.5.7",
"composer/xdebug-handler": "^2.0.2 || ^3.0.3",
"justinrainbow/json-schema": "^5.3",
"php": "^7.2.5 || ^8.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"react/promise": "^3.2",
"seld/jsonlint": "^1.4",
"seld/phar-utils": "^1.2",
"seld/signal-handler": "^2.0",
"symfony/console": "^5.4.35 || ^6.3.12 || ^7.0.3",
"symfony/filesystem": "^5.4.35 || ^6.3.12 || ^7.0.3",
"symfony/finder": "^5.4.35 || ^6.3.12 || ^7.0.3",
"symfony/polyfill-php73": "^1.24",
"symfony/polyfill-php80": "^1.24",
"symfony/polyfill-php81": "^1.24",
"symfony/process": "^5.4.35 || ^6.3.12 || ^7.0.3"
},
...
Related: https://github.com/composer/composer/issues/11884 – [feature] Build and distribute scoped version of Composer https://github.com/wp-cli/wp-cli/issues/5920 – Conflict-free distribution - current state and issues that need solving
came searching for the exact same issue.
❯ wp scaffold package rocket/info
Success: Created package files in /Users/gilzow/.wp-cli/packages/local/rocket/info
Success: Created package test files.
Success: Created package readme.
Success: Created package GitHub configuration.
Installing package rocket/info (dev-main || dev-master || dev-trunk)
Updating /Users/gilzow/.wp-cli/packages/composer.json to require the package...
Registering /Users/gilzow/.wp-cli/packages/local/rocket/info as a path repository...
Using Composer to install the package...
---
Loading composer repositories with package information
PHP Fatal error: Declaration of React\Promise\Internal\FulfilledPromise::then(?callable $onFulfilled = null, ?callable $onRejected = null): React\Promise\PromiseInterface must be compatible with React\Promise\PromiseInterface::then(?callable $onFulfilled = null, ?callable $onRejected = null, ?callable $onProgress = null) in /Users/gilzow/.wp-cli/packages/vendor/react/promise/src/Internal/FulfilledPromise.php on line 37
Fatal error: Declaration of React\Promise\Internal\FulfilledPromise::then(?callable $onFulfilled = null, ?callable $onRejected = null): React\Promise\PromiseInterface must be compatible with React\Promise\PromiseInterface::then(?callable $onFulfilled = null, ?callable $onRejected = null, ?callable $onProgress = null) in /Users/gilzow/.wp-cli/packages/vendor/react/promise/src/Internal/FulfilledPromise.php on line 37
Reverted composer.json.
❯ cat ~/.wp-cli/packages/composer.json
{
"name": "wp-cli/wp-cli",
"description": "Installed community packages used by WP-CLI",
"version": "2.11.0",
"authors": [
{
"name": "WP-CLI",
"email": "noreply@wpcli.org"
}
],
"homepage": "https://wp-cli.org/package-index/",
"require": {
"wp-cli/scaffold-package-command": "@stable"
},
"require-dev": {},
"minimum-stability": "dev",
"prefer-stable": true,
"license": "MIT",
"repositories": {
"wp-cli": {
"type": "composer",
"url": "https://wp-cli.org/package-index/"
}
},
"config": {
"secure-http": true
}
}
Bug Report
Describe the current, buggy behavior
Describe how other contributors can replicate this bug
Also tried with
@stable
Describe what you would expect as the correct outcome
Let us know what environment you are running this on
Provide a possible solution
Maybe the required package is locked and a bugfix version is available?
Provide additional context/Screenshots
Same issue under PHP 8.3 and 7.4 and on another machine.