figlab/coding-standard

PHPCS coding-standard for Laravel applications.

Installs: 134

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

1.0.4 2024-08-06 01:40 UTC

This package is auto-updated.

Last update: 2024-11-06 06:08:19 UTC


README

PHPCS coding-standard for Laravel applications and packages. Based on the awesome IxDF Coding Standard.

Installation

  1. Install the package via composer by running:
composer require --dev figlab/coding-standard
  1. Add composer scripts into your composer.json:
"scripts": {
  "cs:check": "phpcs -p -s --colors --report-full --report-summary",
  "cs:fix": "phpcbf -p --colors"
}
  1. Create file phpcs.xml on base path of your repository with content
<?xml version="1.0"?>
<ruleset name="My Coding Standard">
    <!-- Include all rules from the IxDF Coding Standard -->
    <rule ref="FigLabCodingStandard"/>

    <!-- Paths to check -->
    <file>app</file>
    <file>config</file>
    <file>database</file>
    <file>lang</file>
    <file>routes</file>
    <file>tests</file>
</ruleset>

Usage

  • To run checks only:
composer cs:check
  • To automatically fix CS issues:
composer cs:fix