artisanpack-ui/code-style
Composer 安装命令:
composer require artisanpack-ui/code-style
包简介
A custom PHP code style standard based on PHPStorm settings. This package provides custom sniffs for PHP_CodeSniffer that enforce consistent code style across your PHP projects.
README 文档
README
A custom PHP code style standard based on PHPStorm settings. This package provides custom sniffs for PHP_CodeSniffer that enforce consistent code style across your PHP projects.
Installation
You can install the ArtisanPack UI Code Standards package by running the following composer command:
composer require artisanpack-ui/code-style --dev
Usage
Configuration
After installation, you can create a phpcs.xml file in your project root with the following content:
<?xml version="1.0"?> <ruleset name="YourProjectStandard"> <description>Your project's coding standard</description> <!-- Use ArtisanPackUI standard --> <rule ref="ArtisanPackUIStandard"/> <!-- Specify paths to check --> <file>app</file> <file>src</file> <file>tests</file> <!-- Exclude paths --> <exclude-pattern>*/vendor/*</exclude-pattern> <exclude-pattern>*/node_modules/*</exclude-pattern> </ruleset>
Running PHP_CodeSniffer
You can run PHP_CodeSniffer with the ArtisanPackUI standard using the following command:
./vendor/bin/phpcs --standard=ArtisanPackUIStandard .
Or if you've set up a custom phpcs.xml file:
./vendor/bin/phpcs
Custom Sniffs
This package includes 16+ custom sniffs covering:
- Formatting: Indentation, braces, spacing, alignment
- Code Structure: Classes, control structures, imports, arrays
- Naming Conventions: PascalCase for classes, camelCase for functions/variables, snake_case for table columns
- Security: Input validation, output escaping (see Security Sniffs)
- Best Practices: Yoda conditionals, type declarations, disallowed functions
For complete details on all sniffs with examples, see the Custom Sniffs Reference.
Customizing Sniffs
You can customize the behavior of the sniffs by overriding their properties in your phpcs.xml file:
<rule ref="ArtisanPackUI.Formatting.Indentation"> <properties> <property name="indent" value="2"/> </properties> </rule>
Documentation
📚 Complete Documentation - Comprehensive guides and references
Quick Links
- Installation Guide - Detailed installation instructions
- Usage Guide - Basic usage and IDE integration
- Troubleshooting - Common issues and solutions
- Customization Guide - How to customize sniffs
- All Sniffs Reference - Complete sniff documentation
- Security Sniffs - Security-focused sniffs
Contributing
🤝 Contributing Guidelines - How to contribute to the project
As an open source project, this package is open to contributions from anyone. Whether you want to report bugs, suggest features, improve documentation, or contribute code, please read through our comprehensive contributing guidelines.
Additional Resources
- AI Guidelines - Guidelines for AI-assisted development
- Code of Conduct - Community standards
artisanpack-ui/code-style 适用场景与选型建议
artisanpack-ui/code-style 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.52k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 artisanpack-ui/code-style 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 artisanpack-ui/code-style 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 19
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-06-08