labelworx/shift-styles
Composer 安装命令:
composer require labelworx/shift-styles
包简介
PHP code linter using Laravel Shift ruleset and PHP-CS-Fixer
README 文档
README
This package allows you to quickly run the Laravel Shift linter commands locally using php artisan shift.
Using PHP CS Fixer and a ruleset created by Laravel Shift, this makes linting your Laravel project simple and adhere to "The Laravel Way".
Your can find the official ruleset used in this package in this gist.
Installation
You can install the ruleset via composer using the following command:
composer require --dev labelworx/shift-styles
Setup
This command will require a .php_cs.dist configuration file for PHP CS Fixer to be available in your project root directory.
You can create this file using the command.
php artisan shift:setup
This file contains the default Laravel folder structure. These are the folders that will be scanned by PHP CS Fixer. You will need to add additional paths to this file if your project structure is different from that listed below.
A typical Laravel Project includes these directories:
<?php $finder = PhpCsFixer\Finder::create() ->in([ __DIR__ . '/app', __DIR__ . '/config', __DIR__ . '/database', __DIR__ . '/resources', __DIR__ . '/routes', __DIR__ . '/tests', ]); return Labelworx\styles($finder);
PHP CS Fixer uses a cache file to speed up usage. You are recommended that to add the .php_cs.cache to you .gitignore file.
Usage
To run and fix files -
php artisan shift
Resources
- Sharing PHP-CS-Fixer rules across projects and teams. Laravel News Article
- Laravel Shift Recommended Coding Ruleset. Gist - Shift
labelworx/shift-styles 适用场景与选型建议
labelworx/shift-styles 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.68k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 09 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「linter」 「laravel」 「php-cs-fixer」 「Shift」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 labelworx/shift-styles 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 labelworx/shift-styles 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 labelworx/shift-styles 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
HiDev plugin for PHP-CS-Fixer
Taptima PHP-CS-Fixer fixers
Axa Zara PHP Code style configuration for `php-cs-fixer` based on PSR-12.
A generic package for implementing Laravel Pint coding standards across Laravel packages
Lot's of tools for git, file and static source code analysis.
Custom cs-fixer rules
统计信息
- 总下载量: 2.68k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-21