2017 © Pedro Peláez
 

library php-cs-fixer-extra

PHP CS Fixer Extra

image

pierophp/php-cs-fixer-extra

PHP CS Fixer Extra

  • Wednesday, March 8, 2017
  • by pierophp
  • Repository
  • 1 Watchers
  • 0 Stars
  • 178 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

PHP CS Extra Fixer

Some extra fixers for SensioLabs PHP CS Fixer. http://cs.sensiolabs.org/, (*1)

Instalation

$ composer require --dev pierophp/php-cs-fixer-extra

Usage

Create a ".php_cs" in the project root with the example content:, (*2)

<?php

$finder = Symfony\Component\Finder\Finder::create()
    ->files()
    ->in(__DIR__)
    ->exclude('vendor')
    ->exclude('resources/views')
    ->exclude('storage')
    ->exclude('public')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return Symfony\CS\Config::create()
    ->addCustomFixer(new \PhpCsFixerExtra\Fixer\PhpdocFullNamespaceFixer())
    ->finder($finder)
    ->setUsingCache(true);

Run the command to fix:, (*3)

$ ./vendor/bin/php-cs-fixer --config-file=./.php_cs fix my_file.php

Configuring in GIT Pre-Commit

If you have GIT 2.9+ you can configure the PHP CS in the pre-commit., (*4)

Create a file with the path "hooks/pre-commit" in the project root with the following content:, (*5)

#!/bin/bash

while read -r file;
do
  file=`echo ${file:1}`
  if [[ $file = *.php && -e $file && $file != *migrations* ]]; then
    ./vendor/bin/php-cs-fixer --config-file=./.php_cs fix $file
    git add $file
  fi
done < <(git diff --cached --name-status --diff-filter=ACM) 

After, add in git:, (*6)

$ git config --add core.hooksPath hooks/

The Versions

08/03 2017

dev-master

9999999-dev

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti

08/03 2017

v0.0.7

0.0.7.0

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti

08/03 2017

v0.0.6

0.0.6.0

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti

08/03 2017

v0.0.5

0.0.5.0

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti

06/12 2016

v0.0.4

0.0.4.0

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti

28/11 2016

v0.0.3

0.0.3.0

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti

23/11 2016

v0.0.2

0.0.2.0

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti

23/11 2016

v0.0.1

0.0.1.0

PHP CS Fixer Extra

  Sources   Download

MIT

The Requires

 

The Development Requires

by Piero Giusti