Skip to content

Commit

Permalink
Merge pull request #1903 from Quetzacoalt91/add-misisng-composer-require
Browse files Browse the repository at this point in the history
Add missing composer require commands as somes packages of php-dev-tools are suggestions instead of requirements
  • Loading branch information
kpodemski authored Dec 20, 2024
2 parents 22e60d2 + dc8b570 commit d09f0fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/testing/advanced-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ The main tools used for unit testing is [PHPUnit](https://phpunit.de/).
Like other PHP testing tools, it can be installed in your project with composer. Take care to install it in your **development dependencies** to avoid distributing in your production releases.

```bash
composer require --dev phpunit/phpunit:5.7
composer require --dev phpunit/phpunit
```

While newer versions of PHPUnit exist, the version chosen in your project must match the PHP compatibility range of the project, otherwise composer will refuse to install it. The version provided in the example above is the last one compatible with PHP 5.6.
Expand Down
6 changes: 4 additions & 2 deletions modules/testing/basic-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ Following the same rules as the core requires the configuration file to be avail
```bash
# Install dependencies
composer require --dev prestashop/php-dev-tools
composer require --dev friendsofphp/php-cs-fixer

# Set up configuration files
php vendor/bin/prestashop-coding-standards cs-fixer:init
```

These commands install and prepare your project for php-cs-fixer and the core standards. The commands have run successfully if a file `.php_cs.dist` exists in the root folder.

[PHP-CS-Fixer](https://packagist.org/packages/friendsofphp/php-cs-fixer) is used to check the code style, and is automatically included in your project if you required `prestashop/php-dev-tools` by following the commands above.
[PHP-CS-Fixer](https://packagist.org/packages/friendsofphp/php-cs-fixer) is used to check the code style. It is suggested by `prestashop/php-dev-tools` on [Packagist](https://packagist.org/packages/prestashop/php-dev-tools), and must be required via composer separately.

It provides two main features:

Expand Down Expand Up @@ -95,7 +96,7 @@ When the extension is open-source, sharing the license is one important task.
In these headers, details can be found about the author, the license, the original year of publication.
One command will apply the license header to all your files, or update it as necessary.

This tool is part of `prestashop/php-dev-tools` available on [Packagist](https://packagist.org/packages/prestashop/php-dev-tools), which can be required via composer.
This tool is suggested by `prestashop/php-dev-tools` on [Packagist](https://packagist.org/packages/prestashop/php-dev-tools), and must be required via composer separately.

### Example

Expand All @@ -108,6 +109,7 @@ To install and use the tool:
```bash
# Install header-stamp
composer require --dev prestashop/php-dev-tools
composer require --dev prestashop/header-stamp

# Apply header block
php vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=vendor,tests,_dev
Expand Down

0 comments on commit d09f0fc

Please sign in to comment.