forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PatchRanger-php-cs-fixer' of https://github.com/PatchRa…
…nger/mautic into PatchRanger-PatchRanger-php-cs-fixer # Conflicts: # composer.lock
- Loading branch information
Showing
4 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
return Symfony\CS\Config\Config::create() | ||
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) | ||
->fixers([ | ||
'align_double_arrow', | ||
'align_equals', | ||
'ordered_use', | ||
'short_array_syntax', | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
ROOT=$(git rev-parse --show-toplevel) | ||
|
||
echo "php-cs-fixer pre commit hook start" | ||
|
||
PHP_CS_FIXER="bin/php-cs-fixer" | ||
HAS_PHP_CS_FIXER=false | ||
|
||
if [ -x $PHP_CS_FIXER ]; then | ||
HAS_PHP_CS_FIXER=true | ||
fi | ||
|
||
if $HAS_PHP_CS_FIXER; then | ||
git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | while read line; do | ||
$PHP_CS_FIXER fix --config-file=$ROOT/.php_cs --verbose "$line"; | ||
git add "$line"; | ||
done | ||
else | ||
echo "" | ||
echo "Please install php-cs-fixer, e.g.:" | ||
echo "" | ||
echo " composer require --dev friendsofphp/php-cs-fixer" | ||
echo "" | ||
fi | ||
|
||
echo "php-cs-fixer pre commit hook finish" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters