cryonighter/cryonighter-coding-standard

cryonighter编码标准的CodeSniffer规则集

安装: 16

依赖项: 0

建议者: 0

安全: 0

星星: 0

观察者: 1

分支: 1

开放问题: 1

类型:phpcodesniffer-standard

1.0.2 2019-08-27 12:14 UTC

This package is not auto-updated.

Last update: 2024-09-18 20:45:46 UTC


README

这是一个检查cryonighter编码标准的编码标准,最初不客气地从已消失的opensky/Symfony2-coding-standard仓库中复制。

通过Composer安装

此标准可以通过Composer依赖管理器安装。

  1. 将编码标准作为项目的依赖项安装

    composer global require cryonighter/cryonighter-coding-standard
    
  2. 将编码标准添加到PHP_CodeSniffer安装路径

    phpcs --config-set installed_paths ../../../vendor/escapestudios/symfony2-coding-standard,../../../vendor/cryonighter/cryonighter-coding-standard
    
  3. 检查已安装的编码标准中的"Symfony"和"Cryonighter"

    phpcs -i
    

独立安装

  1. 安装PHP_CodeSniffer

  2. 检出此仓库

    git clone git://github.com/djoos/Symfony2-coding-standard.git symfony2-coding-standard && git clone git@github.com:cryonighter/cryonighter-coding-standard.git
    
  3. 将编码标准添加到PHP_CodeSniffer安装路径

    phpcs --config-set installed_paths /path/to/symfony2-coding-standard,/path/to/cryonighter-coding-standard
    

    或将SymfonyCryonighter文件夹移动/复制/符号链接到phpcs的Standards目录中

  4. 检查已安装的编码标准中的"Symfony"和"Cryonighter"

    phpcs -i
    

用法

通过命令行

phpcs --standard=Cryonighter --extensions=php --ignore=/path/to/exclude-code /path/to/code

PHP Code Sniffer Wiki: 用法, 高级用法