Skip to content

betaSavvy/phpcs-fixer-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPCS Fixer Config

This repository provides configurations for friendsofphp/php-cs-fixer, which can be used to verify and enforce a coding standard for PHP code within projects.

References from:

Installation

Run

composer require --dev betasavvy/phpcs-fixer-config

Add to composer.json (optional)

"scripts": {
  "check": [
    "@cs", 
  ],
  "cs": "php-cs-fixer fix -v --diff --dry-run",
  "cs-fix": "php-cs-fixer fix -v --diff"
}

Usage

Configuration

Create a configuration file .php_cs in the root of your project.

<?php

$config = new BetaSavvy\Fixer\Config();
$config->getFinder()
//        ->exclude(['fixture'])
        ->in([
            __DIR__ . '/app',
            __DIR__ . '/config',
            __DIR__ . '/database',
            __DIR__ . '/routes',
            __DIR__ . '/tests',
        ]);

return $config;

Git

Add .php_cs.cache (file is created by php-cs-fixer) to .gitignore

vendor/
.php_cs.cache

License

This package is licensed using the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages