You run composer require monolog/monolog in your PHP project. Then you run composer show monolog/monolog. What output will you see?
Think about what composer show does for a specific package.
The composer show monolog/monolog command displays detailed info about the installed package, including its name, version, description, and dependencies.
You run composer require vendor/nonexistent-package in your project. What will happen?
Composer only installs packages that exist in repositories it knows.
If the package does not exist, Composer will stop and show an error message saying it could not find the package.
You manually add a new package to composer.json under require but running composer install does not install it. Why?
Think about the difference between composer install and composer update.
composer install installs packages listed in composer.lock. If you manually add a package to composer.json, you must run composer update to install it and update composer.lock.
Choose the correct require section snippet to require guzzlehttp/guzzle version 7.0 or higher but less than 8.0.
Composer uses caret (^) for compatible version ranges.
The caret operator ^7.0 means any version from 7.0 up to but not including 8.0, which matches the requirement.
You want to add phpunit/phpunit as a dependency only for development, not for production. Which command do you run?
Think about the flag that marks a package as development-only.
The --dev flag adds the package to the require-dev section, so it is installed only in development environments.