3. composer

https://getcomposer.org/

3.1. Install

$ brew install composer

Tip

PHP is also installed as a dependency.

Check the version:

$ composer --version
Composer version 2.7.9 2024-09-04 14:43:28
PHP version 8.3.11 (/usr/local/Cellar/php/8.3.11/bin/php)
Run the "diagnose" command to get more detailed diagnostics output.

3.2. Usage

Create a basic composer.json file in current directory by:

$ composer init

Install components:

$ composer install

This command installs the project dependencies from the composer.lock file if present, or falls back on the composer.json file.

Test:

$ composer test