prestashop/php-coding-standards 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

prestashop/php-coding-standards

最新稳定版本:v5

Composer 安装命令:

composer require prestashop/php-coding-standards

包简介

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

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.

统计信息

  • 总下载量: 24.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 34
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 34
  • Watchers: 14
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-13