prosales/phpcs-coding-standard

CodeSniffer ruleset for the Symfony 2+ coding standard

dev-master 2019-01-04 17:57 UTC

This package is auto-updated.

Last update: 2019-10-04 19:52:11 UTC


README

[pipeline status](https://gitlab.pro-sales.ch/contribution/phpcs-coding-standard/commits/master coverage report

A coding standard to check against the Symfony coding standards, originally shamelessly copied from the djoos/Symfony-coding-standard on GitHub. The truth is that we are using Laravel instead of Symfony but since both rely on the same structure and based on the fact that the Laravel framework is built off Symfony, we can use this setup within both frameworks without any doubts.

Requirements

Composer

This package utilizes Composer to manage its PHP dependencies. So, before using the package, make sure you have the latest version of Composer installed on your machine. Please follow the official documentation: https://getcomposer.org/download/, in order to install Composer. You can always upgrade your current Composer version using the composer self-update command within your terminal.

PHP CodeSniffer

PHP CodeSniffer is an essential development tool that ensures your code remains clean and consistent. Please ensure that you are using the latest version of CodeSniffer.

PHPStorm IDE

Think about how many hours each week you spend within your editor. Doesn't it make sense to unlock every inch of its capabilities? Since an implementation for PHP CodeSniffer has already been prepared for you - this will be a cinch. All you need to do is to ensure that you are running on the latest PHPStorm version.

PHP

Well using PHPCodeSniffer is like to drive a car without an engine. So please ensure that you have a running PHP environment using PHP >=7.1.3. This is the PHP setup recommended for new Laravel applications hence you may need to install the following PHP extensions as well.

OpenSSL
PDO
MBString
Tokenizer
XML
CType
JSON

Installation

Step-01: Download Coding Standards

First lets begin to download the coding standards within our terminal:

composer global require prosales/phpcs-coding-standard

Step-02: Enable CodeSniffer in PHPStorm

Next you will need to open your PHPStorm configuration (ctrl+alt+s) and search for: sniffer.

motive PHPStorm inspections

  • [ ] Ensure that you have enabled CodeSniffer.
  • [ ] Choose Custom coding standard and click to the settings (...).
  • [ ] Set the path to your ruleset.

Chat on Discord

All-in-one voice and text chat for contributors that's free, secure, and works on both your desktop and phone. Stop paying for TeamSpeak servers and hassling with Skype. Simplify your life with DiscordApp.