mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 01:44:03 +00:00
PHP CS Fixer 3
This commit is contained in:
parent
3b203d70ff
commit
19d46fc916
4 changed files with 8 additions and 8 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -42,7 +42,7 @@ jobs:
|
||||||
- name: Install php-cs-fixer
|
- name: Install php-cs-fixer
|
||||||
run: composer global require friendsofphp/php-cs-fixer
|
run: composer global require friendsofphp/php-cs-fixer
|
||||||
- name: Run php-cs-fixer
|
- name: Run php-cs-fixer
|
||||||
run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config=.php_cs.php
|
run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php
|
||||||
- name: Commit changes from php-cs-fixer
|
- name: Commit changes from php-cs-fixer
|
||||||
uses: EndBug/add-and-commit@v5
|
uses: EndBug/add-and-commit@v5
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -2,7 +2,7 @@
|
||||||
package-lock.json
|
package-lock.json
|
||||||
composer.lock
|
composer.lock
|
||||||
vendor/
|
vendor/
|
||||||
.php_cs.cache
|
.php-cs-fixer.cache
|
||||||
.vscode/
|
.vscode/
|
||||||
coverage/
|
coverage/
|
||||||
node_modules
|
node_modules
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ $rules = [
|
||||||
'linebreak_after_opening_tag' => true,
|
'linebreak_after_opening_tag' => true,
|
||||||
'line_ending' => true,
|
'line_ending' => true,
|
||||||
'lowercase_cast' => true,
|
'lowercase_cast' => true,
|
||||||
'lowercase_constants' => true,
|
'constant_case' => true,
|
||||||
'lowercase_keywords' => true,
|
'lowercase_keywords' => true,
|
||||||
'lowercase_static_reference' => true, // added from Symfony
|
'lowercase_static_reference' => true, // added from Symfony
|
||||||
'magic_method_casing' => true, // added from Symfony
|
'magic_method_casing' => true, // added from Symfony
|
||||||
|
|
@ -137,7 +137,7 @@ $finder = Finder::create()
|
||||||
->ignoreDotFiles(true)
|
->ignoreDotFiles(true)
|
||||||
->ignoreVCS(true);
|
->ignoreVCS(true);
|
||||||
|
|
||||||
return Config::create()
|
return (new Config())
|
||||||
->setFinder($finder)
|
->setFinder($finder)
|
||||||
->setRules($rules)
|
->setRules($rules)
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
8
check
8
check
|
|
@ -16,21 +16,21 @@ offer_run() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (php-cs-fixer fix --dry-run --config=.php_cs.php > /dev/null 2>/dev/null); then
|
if (php-cs-fixer fix --dry-run --config=.php-cs-fixer.php > /dev/null 2>/dev/null); then
|
||||||
echo '✅ php-cs-fixer OK'
|
echo '✅ php-cs-fixer OK'
|
||||||
else
|
else
|
||||||
read -p "⚠️ php-cs-fixer found issues. Fix (Y/n)? " fix
|
read -p "⚠️ php-cs-fixer found issues. Fix (Y/n)? " fix
|
||||||
case ${fix:0:1} in
|
case ${fix:0:1} in
|
||||||
n|N )
|
n|N )
|
||||||
echo '❌ php-cs-fixer FAIL'
|
echo '❌ php-cs-fixer FAIL'
|
||||||
offer_run 'php-cs-fixer fix --config=.php_cs.php'
|
offer_run 'php-cs-fixer fix --config=.php-cs-fixer.php'
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
if (php-cs-fixer fix --config=.php_cs.php > /dev/null 2>/dev/null); then
|
if (php-cs-fixer fix --config=.php-cs-fixer.php > /dev/null 2>/dev/null); then
|
||||||
echo '✅ php-cs-fixer OK'
|
echo '✅ php-cs-fixer OK'
|
||||||
else
|
else
|
||||||
echo '❌ php-cs-fixer FAIL'
|
echo '❌ php-cs-fixer FAIL'
|
||||||
offer_run 'php-cs-fixer fix --config=.php_cs.php'
|
offer_run 'php-cs-fixer fix --config=.php-cs-fixer.php'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue