Download the PHP package huangdijia/php-coding-standard without Composer

On this page you can find all versions of the php package huangdijia/php-coding-standard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-coding-standard

PHP 代码规范

CI

基于 PHP CS Fixer 的全面 PHP 代码规范配置,适用于个人和团队使用。

特性

系统要求

安装

通过 composer 安装为开发依赖:

快速开始

选项 1:使用提供的模板文件

将配置模板复制到项目根目录:

编辑复制的 .php-cs-fixer.php 文件以匹配您的项目详情:

选项 2:替换现有的 php-cs-fixer

如果您的项目中已经有 friendsofphp/php-cs-fixer:

使用方法

基本命令

修复代码风格问题:

试运行(预览更改而不应用):

如果您配置了 composer 脚本:

高级配置

自定义规则

您可以使用流式 API 添加或覆盖规则:

可用方法

头部注释配置

setHeaderComment 方法支持灵活的联系人格式:

Laravel 项目配置

针对 Laravel 项目使用 forLaravel() 方法:

此方法会自动调整一些规则以更好地适配 Laravel 的编码风格。

库/包项目配置

对于库和包开发,使用 disableRiskyRules() 方法以实现更安全的修复:

排除目录

自定义要扫描的目录:

配置示例

项目提供了多个配置示例文件,位于 examples/ 目录:

您可以参考这些示例来配置您的项目:

集成

CI/CD

GitHub Actions 工作流示例:

预提交钩子

添加到 .git/hooks/pre-commit:

或使用项目提供的预提交钩子脚本:

包含的规则

此配置包含:

主要自定义:

贡献

  1. Fork 仓库
  2. 创建您的功能分支
  3. 提交您的更改
  4. 推送到分支
  5. 创建 Pull Request

请确保所有代码都遵循既定的编码标准,运行:

运行测试

本项目使用 PHPUnit 进行测试。在提交更改之前,请运行测试以确保没有破坏现有功能:

您也可以运行静态分析:

安全

如果您发现任何安全漏洞,请发送邮件到 [email protected],而不要使用问题跟踪器。

更新日志

请参阅 CHANGELOG 了解最近的更改信息。

许可证

MIT 许可证。请参阅 License File 了解更多信息。


All versions of php-coding-standard with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ergebnis/composer-normalize Version ^2.43
friendsofphp/php-cs-fixer Version ^3.64.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package huangdijia/php-coding-standard contains the following files

Loading the files please wait ...