-
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.
- Loading branch information
Showing
28 changed files
with
139 additions
and
113 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,92 +1,12 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->exclude('bin') | ||
->exclude('cache') | ||
->exclude('doc') | ||
->exclude('logs') | ||
->exclude('vendor') | ||
; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) | ||
->setRules([ | ||
'@Symfony' => true, | ||
|
||
'array_indentation' => true, | ||
'array_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'trailing_comma_in_multiline' => [ | ||
'elements' => ['arrays', 'arguments', 'parameters'], | ||
], | ||
'dir_constant' => true, | ||
'ereg_to_preg' => true, | ||
'explicit_indirect_variable' => true, | ||
'explicit_string_variable' => true, | ||
'fopen_flag_order' => true, | ||
'single_line_comment_style' => [ | ||
'comment_types' => ['hash'], | ||
], | ||
'heredoc_indentation' => true, | ||
'heredoc_to_nowdoc' => true, | ||
'implode_call' => true, | ||
'is_null' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'list_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'logical_operators' => true, | ||
'method_chaining_indentation' => true, | ||
'modernize_types_casting' => true, | ||
'multiline_whitespace_before_semicolons' => true, | ||
'no_alias_functions' => true, | ||
'no_alternative_syntax' => true, | ||
'no_null_property_initialization' => true, | ||
'no_php4_constructor' => true, | ||
'echo_tag_syntax' => [ | ||
'format' => 'long', | ||
], | ||
'no_superfluous_elseif' => true, | ||
'no_unneeded_final_method' => true, | ||
'no_unreachable_default_argument_value' => true, | ||
'no_unset_cast' => true, | ||
'no_unset_on_property' => true, | ||
'no_useless_else' => true, | ||
'ordered_class_elements' => true, | ||
'ordered_interfaces' => true, | ||
'php_unit_expectation' => true, | ||
'php_unit_method_casing' => [ | ||
'case' => 'snake_case', | ||
], | ||
'php_unit_mock_short_will_return' => true, | ||
'php_unit_namespaced' => true, | ||
'php_unit_no_expectation_annotation' => true, | ||
'php_unit_set_up_tear_down_visibility' => true, | ||
'php_unit_strict' => true, | ||
'php_unit_test_annotation' => [ | ||
'style' => 'annotation', | ||
], | ||
'php_unit_test_case_static_method_calls' => [ | ||
'call_type' => 'self', | ||
], | ||
'pow_to_exponentiation' => true, | ||
'protected_to_private' => true, | ||
'psr_autoloading' => true, | ||
'self_accessor' => true, | ||
'set_type_to_cast' => true, | ||
'simple_to_complex_string_variable' => true, | ||
'static_lambda' => true, | ||
'strict_comparison' => true, | ||
'strict_param' => true, | ||
'ternary_to_null_coalescing' => true, | ||
'visibility_required' => [ | ||
'elements' => ['property', 'const'], | ||
], | ||
'void_return' => true, | ||
'declare_strict_types' => true, | ||
]) | ||
->setUsingCache(true) | ||
->setFinder($finder) | ||
return \Ssc\Cs\ConfigBuilder::forPath(__DIR__) | ||
->withLicenseHeader(\Ssc\Cs\Factory\LicenseHeader::forPackage( | ||
name: 'ssc/lib', | ||
owners: [[ | ||
'name' => 'Loïc Faugeron', | ||
'email' => '[email protected]', | ||
]], | ||
)) | ||
->build() | ||
; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use Symplify\MonorepoBuilder\Config\MBConfig; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
return \Ssc\Cs\ConfigBuilder::forPath(__DIR__) | ||
->withLicenseHeader(\Ssc\Cs\Factory\LicenseHeader::forPackage( | ||
name: 'ssc/lib', | ||
owners: [[ | ||
'name' => 'Loïc Faugeron', | ||
'email' => '[email protected]', | ||
]], | ||
)) | ||
->build() | ||
; |
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,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
SHORT_HELP="$0 [-h] [-f]'" | ||
|
||
while getopts ":hf" opt; do | ||
case $opt in | ||
h) | ||
echo 'Usage:' | ||
echo " $SHORT_HELP" | ||
echo '' | ||
echo 'Options:' | ||
echo ' -f Fix coding style' | ||
echo '' | ||
exit 0 | ||
;; | ||
f) | ||
echo '' | ||
echo '// Fixing CS...' | ||
echo '' | ||
|
||
vendor/bin/php-cs-fixer fix --allow-risky=yes | ||
exit 0 | ||
;; | ||
\?) | ||
echo '' >&2 | ||
echo " [KO] The \"-$OPTARG\" option does not exist" >&2 | ||
echo '' >&2 | ||
echo " $SHORT_HELP" >&2 | ||
echo '' >&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
unset SHORT_HELP | ||
|
||
echo '' | ||
echo '// Running tests...' | ||
|
||
composer --quiet dump --optimize | ||
|
||
vendor/bin/phpspec --no-interaction run -fdot && \ | ||
# vendor/bin/phpunit && \ | ||
vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run |
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
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,6 @@ | ||
<?php | ||
|
||
/* | ||
/** | ||
* This file is part of the ssc/lib package. | ||
* | ||
* (c) Loïc Faugeron <[email protected]> | ||
|
Oops, something went wrong.