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
dealerdirect/phpcodesniffer-composer-installer v1.0.0 PHP_CodeSniffer Standards Composer Installer Plugin
phpstan/phpdoc-parser 1.24.3 PHPDoc parser with support for nullable, intersection and generic types
slevomat/coding-standard 8.14.1 Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with a...
squizlabs/php_codesniffer 3.7.2 PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding stand...
With the --direct option:
slevomat/coding-standard 8.14.1 Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.
If we specify a not installed package to the composer show command, like composer show not/existent, we got the following error:
In ShowCommand.php line 300:
Package "not/existent" not found, try using --available (-a) to show all available packages.
And the command exit with an error code.
I would like to combine this behavior in combination with the --direct option to ensure a package is installed and required by the root package itself.
However, if I try with composer show --direct squizlabs/php_codesniffer, which is installed but not explicitly required, the commands successfully display the package information instead of exiting with an error code.
I would like an option to ensure a package is directly required by the root package and make the command throwing an error otherwise, like the sample above.
What do you think about this idea?
Regards
The text was updated successfully, but these errors were encountered:
@soullivaneuh you may be interested in https://github.com/maglnet/ComposerRequireChecker. It's a tool that helps ensure that dependencies are declared properly. I can't quite tell from the description you have provided if this meets your needs or not. Why are you trying to work out if a particular package is listed as a direct dependency for a project?
Sounds reasonable to me to fix this behavior. It was just not considered I believe because if the package is there we just show it, and direct is only used for listing right now, but it wouldn't hurt to check for directness when requesting a single package IMO. If you like to PR it..
With the given
composer.json
:The
compose show
command displays the following:With the
--direct
option:If we specify a not installed package to the
composer show
command, likecomposer show not/existent
, we got the following error:And the command exit with an error code.
I would like to combine this behavior in combination with the
--direct
option to ensure a package is installed and required by the root package itself.However, if I try with
composer show --direct squizlabs/php_codesniffer
, which is installed but not explicitly required, the commands successfully display the package information instead of exiting with an error code.I would like an option to ensure a package is directly required by the root package and make the command throwing an error otherwise, like the sample above.
What do you think about this idea?
Regards
The text was updated successfully, but these errors were encountered: