定制 prestashop/php-dev-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

prestashop/php-dev-tools

最新稳定版本:v5

Composer 安装命令:

composer require prestashop/php-dev-tools

包简介

PrestaShop coding standards

README 文档

README

Latest Stable Version Minimum PHP Version Quality Control Status

This repository includes tools to check that repositories are following the standards defined by the PrestaShop community and provides configuration files for some of them.

Related packages:

Installation

composer require --dev prestashop/php-dev-tools

## Development dependencies runtimes
composer require --dev friendsofphp/php-cs-fixer
composer require --dev phpstan/phpstan
composer require --dev prestashop/header-stamp
composer require --dev prestashop/autoindex
composer require --dev squizlabs/php_codesniffer

When this project is successfully added to your dependencies, you can enable each review tool on your projet.

Version Guidance

Version Status Packagist - Namespace Repo Docs PHP Version
1.x EOL prestashop/php-dev-tools N/A v1.x N/A >=5.6,<7.2
2.x EOL prestashop/php-dev-tools N/A v2.x N/A >=5.6,<7.2
3.x Security fixes prestashop/php-dev-tools N/A v3.x N/A >=5.6,>=7.2.5
4.x EOL prestashop/php-dev-tools N/A v4.x N/A >=7.2.5
5.x Latest prestashop/php-dev-tools N/A master N/A >=7.2.5

Usage

The configuration files added in your project can be freely modified in order to match your needs.

Running the tools can be done by calling their respective binary:

PHP CS Fixer

Initialize the configuration with:

$ php vendor/bin/prestashop-coding-standards cs-fixer:init [--dest /path/to/my/project]

It'll create a configuration file .php-cs-fixer.dist.php in the root of your project.

Upgrade note : When upgrading from 4.1.0 to newer version, you should re-run the init script or rename your .php_cs.dist file to .php-cs-fixer.dist.php in order to match the new requirements of cs-fixer.

$ vendor/bin/php-cs-fixer fix

PHPStan

$ php vendor/bin/prestashop-coding-standards phpstan:init [--dest /path/to/my/project]

It'll create a default file phpstan.neon in tests/phpstan, that are required to run phpstan. The default phpstan level is the lowest available, but we recommend you to update this value to get more recommandations.

$ _PS_ROOT_DIR_=<Path_to_PrestaShop> php vendor/bin/phpstan --configuration=tests/phpstan/phpstan.neon analyse <path1 [path2 [...]]>

Autoindex

Applying an index.php file to all your project subfolders will be useful to avoid directories to be listed by the webserver.

$ vendor/bin/autoindex prestashop:add:index <path>

Header Stamp

Your license headers can be updated by applying the header stamp.

Here is an example of call, applying the default license on a PrestaShop module:

$ vendor/bin/header-stamp --license=assets/afl.txt --exclude=vendor,node_modules

Available options are provided with --help.

统计信息

  • 总下载量: 2M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 35
  • 点击次数: 0
  • 依赖项目数: 97
  • 推荐数: 0

GitHub 信息

  • Stars: 35
  • Watchers: 12
  • Forks: 20
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04