Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patricnox/laravel-phpcs
PHP Codesniffer ruleset to follow Laravel's definition of PSR-12 coding style
https://github.com/patricnox/laravel-phpcs
hacktoberfest hacktoberfest2022 laravel-ruleset laravel-standard php-codesniffer phpcs-laravel phpcs-standard ruleset
Last synced: about 2 months ago
JSON representation
PHP Codesniffer ruleset to follow Laravel's definition of PSR-12 coding style
- Host: GitHub
- URL: https://github.com/patricnox/laravel-phpcs
- Owner: PatricNox
- License: mit
- Created: 2020-08-12T17:54:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-05T22:46:36.000Z (over 1 year ago)
- Last Synced: 2024-10-21T03:04:34.929Z (2 months ago)
- Topics: hacktoberfest, hacktoberfest2022, laravel-ruleset, laravel-standard, php-codesniffer, phpcs-laravel, phpcs-standard, ruleset
- Homepage:
- Size: 28.3 KB
- Stars: 38
- Watchers: 3
- Forks: 24
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP CodeSniffer rules for Laravel coding style (PSR-2 variant)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![PR friendly repository](https://img.shields.io/badge/Pull--Request-are%20welcome!-ff69b4)](/compare)
![Follow Fossbarrow on Twitter](https://img.shields.io/twitter/follow/fossbarrow?style=social)> Authored by fossbarrow IO
[php codesniffer ruleset](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset) for laravel projects.
## Requirements
- https://github.com/squizlabs/PHP_CodeSniffer
## Table of contents
- [How to install](#install)
- [Enabling the rules](#enabling-the-rules)
- [Sniffing code](#sniffing-code)
- [Sniffing code in PHPStorm](#sniffing-code-in-phpstorm)
- [License](#license)
- [Contributing](#contributing)
- [Credits](#credits)## Installation
Install the ruleset by1. Copy the `phpcs.xml` file into your project root with phpcs installed.
## Usage
### Enabling the rules
> Only neccesary if you installed as a package using composer!
Add it to your project `phpcs.xml` or `phpcs.xml.dist` ruleset:
```xml
./app
./config
./resources
./routes
./tests
```
### Sniffing code
Use php CodeSniffer commands, pointed towards your xml file, to sniff the code
using the new ruleset.> vendor/bin/phpcs
> vendor/bin/phpcbf#### Sniffing code in PHPStorm
See [PHP Code Sniffer in PhpStorm](https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm) on how to set up CodeSniffer in PHPStorm.
--------------------------------------------------------------------------------
## Contributing
All changes that makes the sniffer more accurate towards _Laravel_'s coding standard
is always highly appreciated and welcome.Please see [CONTRIBUTING](docs/CONTRIBUTING.md) for more details.
## Credits
- [PatricNox](https://github.com/PatricNox)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.