https://github.com/mediebruket/wp-coding-standards
Mediebruket Coding Standards for PHP_CodeSniffer
https://github.com/mediebruket/wp-coding-standards
codesniffer-rules phpcs wordpress
Last synced: 5 months ago
JSON representation
Mediebruket Coding Standards for PHP_CodeSniffer
- Host: GitHub
- URL: https://github.com/mediebruket/wp-coding-standards
- Owner: mediebruket
- License: mit
- Created: 2020-12-01T10:11:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-21T09:41:04.000Z (about 5 years ago)
- Last Synced: 2025-10-11T19:10:12.255Z (8 months ago)
- Topics: codesniffer-rules, phpcs, wordpress
- Homepage: https://packagist.org/packages/mediebruket/wp-coding-standards
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Mediebruket WordPress Coding Standards
We've transitioned to use [PSR-12 coding style](https://www.php-fig.org/psr/psr-12/) for our own Wordpress projects.
## Installation
```bash
composer require mediebruket/wp-coding-standards --dev
```
Copy and modify the sample configuration file.
```bash
cp vendor/mediebruket/wp-coding-standards/phpcs.xml.dist.sample phpcs.xml.dist
```
## Usage
Check manually by running PHPCS from command line and specify the coding standard:
```bash
vendor/bin/phpcs --standard="Mediebruket"
```
### PHPStorm Setup
Alternatively, the coding standard can be enabled in Phpstorm.
Phpstorm needs to know where PHP_CodeSniffer is located. Navigate to **Languages & Frameworks > PHP > Quality tools > PHP_CodeSniffer** and
specify the path the `phpcs` executable in your `vendor` directory by clicking **…** . Additionally, you can add the
path to `phpcbf` as well.
Then you'll have to specify the coding standard. Navigate to **Editor > Inspections > PHP > Quality tools > PHP_CodeSniffer validation > Options > Coding standard**.
Chose the preferred coding standard from the options section.