You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's impossible to set the extra.phpcodesniffer-search-depth config value from the command line because it strictly enforces an integer type on it, whereas composer config cannot set integer values (see composer/composer#8195):
$ composer init -n
$ composer config extra.phpcodesniffer-search-depth 4
$ cat composer.json
{
"require": {},
"extra": {
"phpcodesniffer-search-depth": "4"
}
}
$ composer require --dev dealerdirect/phpcodesniffer-composer-installer
Using version ^0.5.0 for dealerdirect/phpcodesniffer-composer-installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing squizlabs/php_codesniffer (3.4.2): Loading from cache
- Installing dealerdirect/phpcodesniffer-composer-installer (v0.5.0): Loading from cache
Writing lock file
Generating autoload files
Installation failed, reverting ./composer.json to its original content.
[InvalidArgumentException]
The value of "phpcodesniffer-search-depth" (in the composer.json "extra".section) must be an integer larger then 0, '4' given.
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
I currently use the following fairly ugly kludge as a workaround:
sed -i'.bak' 's|"phpcodesniffer-search-depth": "4"|"phpcodesniffer-search-depth": 4|' composer.json && rm composer.json.bak
For its part, I've requested that Composer provide the ability to typecast data on the commandline (again, see composer/composer#8195). On this side, it would be nice if phpcodesniffer-composer-installer would typecast string values to integers. Would the maintainers accept a pull request to that effect?
The text was updated successfully, but these errors were encountered:
We would definitely welcome such a contribution but (as you may have noticed from my late response) we don't have much time/energy to spend on this project currently.
So, if you do decide to open an MR, don't feel discouraged if our response is slow!
It's impossible to set the
extra.phpcodesniffer-search-depth
config value from the command line because it strictly enforces an integer type on it, whereascomposer config
cannot set integer values (see composer/composer#8195):I currently use the following fairly ugly kludge as a workaround:
For its part, I've requested that Composer provide the ability to typecast data on the commandline (again, see composer/composer#8195). On this side, it would be nice if
phpcodesniffer-composer-installer
would typecast string values to integers. Would the maintainers accept a pull request to that effect?The text was updated successfully, but these errors were encountered: