This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DevKit updates for 2.x branch (#488)
* DevKit updates * DevKit updates * remove styleCI * Fix cs
- Loading branch information
1 parent
e5ec0df
commit 230b8fa
Showing
80 changed files
with
351 additions
and
340 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,5 @@ | ||
<?php | ||
|
||
/* | ||
* DO NOT EDIT THIS FILE! | ||
* | ||
* It's auto-generated by sonata-project/dev-kit package. | ||
* | ||
* Package `sllh/php-cs-fixer-styleci-bridge` is required to get it working. | ||
*/ | ||
// TO BE REMOVED. | ||
|
||
require_once __DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php'; | ||
|
||
use SLLH\StyleCIBridge\ConfigBridge; | ||
|
||
$header = <<<EOF | ||
This file is part of the Sonata Project package. | ||
(c) Thomas Rabaix <[email protected]> | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
// PHP-CS-Fixer 1.x | ||
if (class_exists('Symfony\CS\Fixer\Contrib\HeaderCommentFixer')) { | ||
\Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); | ||
} | ||
|
||
$config = ConfigBridge::create() | ||
->setUsingCache(true) | ||
; | ||
|
||
// PHP-CS-Fixer 2.x | ||
if (method_exists($config, 'setRules')) { | ||
$config->setRules(array_merge($config->getRules(), array( | ||
'header_comment' => array('header' => $header) | ||
))); | ||
} | ||
|
||
return $config; | ||
return require_once __DIR__.'/.php_cs.dist'; |
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,77 @@ | ||
<?php | ||
|
||
/** | ||
* DO NOT EDIT THIS FILE! | ||
* | ||
* It's auto-generated by sonata-project/dev-kit package. | ||
*/ | ||
|
||
$header = <<<'HEADER' | ||
This file is part of the Sonata Project package. | ||
(c) Thomas Rabaix <[email protected]> | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
HEADER; | ||
|
||
$rules = [ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'array_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'combine_consecutive_issets' => true, | ||
'combine_consecutive_unsets' => true, | ||
'header_comment' => [ | ||
'header' => $header, | ||
], | ||
'no_extra_consecutive_blank_lines' => true, | ||
'no_php4_constructor' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => true, | ||
'ordered_imports' => true, | ||
'phpdoc_order' => true, | ||
// To be tested before insertion: | ||
// 'strict_comparison' => true, | ||
// 'strict_param' => true, | ||
// 'php_unit_strict' => true, | ||
]; | ||
|
||
if (\PHP_VERSION_ID >= 50600) { | ||
$rules = array_merge($rules, [ | ||
'@PHP56Migration' => true, | ||
'@PHP56Migration:risky' => true, | ||
'@PHPUnit57Migration:risky' => true, | ||
]); | ||
} | ||
if (\PHP_VERSION_ID >= 70000) { | ||
$rules = array_merge($rules, [ | ||
'@PHP70Migration' => true, | ||
'@PHP70Migration:risky' => true, | ||
'@PHPUnit60Migration:risky' => true, | ||
]); | ||
} | ||
if (\PHP_VERSION_ID >= 70100) { | ||
$rules = array_merge($rules, [ | ||
'@PHP71Migration' => true, | ||
'@PHP71Migration:risky' => true, | ||
'compact_nullable_typehint' => true, | ||
]); | ||
} | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(preg_match('/dev-kit\/project$/', __DIR__, $matches) ? __DIR__.'/..' : __DIR__) | ||
->exclude('Tests/Fixtures') | ||
->exclude('tests/Fixtures') | ||
->exclude('Resources/skeleton') | ||
->exclude('Resources/public/vendor') | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setFinder($finder) | ||
->setRiskyAllowed(true) | ||
->setRules($rules) | ||
->setUsingCache(true) | ||
; |
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 |
---|---|---|
@@ -1,30 +1 @@ | ||
# DO NOT EDIT THIS FILE! | ||
# | ||
# It's auto-generated by sonata-project/dev-kit package. | ||
# | ||
# Package `sllh/php-cs-fixer-styleci-bridge` is required to get it working. | ||
|
||
preset: symfony | ||
|
||
enabled: | ||
- combine_consecutive_unsets | ||
- short_array_syntax | ||
- newline_after_open_tag | ||
- no_php4_constructor | ||
- no_useless_else | ||
- ordered_class_elements | ||
- ordered_use | ||
# Comment strict rules for the moment. Should be uncomment later to see StyleCI PR results | ||
# - strict | ||
# - strict_param | ||
# - php_unit_construct | ||
# - php_unit_strict | ||
|
||
finder: | ||
exclude: | ||
- 'Tests/Fixtures' | ||
- 'tests/Fixtures' | ||
# ecommerce special case: | ||
- 'Resources/skeleton' | ||
# ignore vendor assets | ||
- 'Resources/public/vendor' | ||
# TO BE REMOVED |
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
#!/usr/bin/env sh | ||
set -ev | ||
|
||
mkdir --parents "${HOME}/bin" | ||
|
||
wget "http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" --output-document="${HOME}/bin/php-cs-fixer" | ||
chmod u+x "${HOME}/bin/php-cs-fixer" | ||
|
||
composer global require sllh/composer-lint:@stable --prefer-dist --no-interaction | ||
|
||
gem install yaml-lint |
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
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
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
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
Oops, something went wrong.