-
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.
style #49 Correct Style (apply fixes from PhpStan) and Travis improve…
…ment (sstok) This PR was merged into the 2.0-dev branch. Discussion ---------- | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | - Set-up PHP-CS-Fixer using Travis - Set-up PHPStan using Travis And fix reported errors and style violations. Commits ------- 0da0543 Correct Style (and apply fixes from PhpStan) 336a7c8 Travis configuration improvements 5cada45 Rename .php_cs to .php_cs.dist 69fe9dc Fix phpstan violation
- Loading branch information
Showing
16 changed files
with
111 additions
and
83 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,51 @@ | ||
<?php | ||
|
||
$header = <<<EOF | ||
This file is part of the RollerworksSearch package. | ||
(c) Sebastiaan Stok <[email protected]> | ||
This source file is subject to the MIT license that is bundled | ||
with this source code in the file LICENSE. | ||
EOF; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'@PHP70Migration' => true, | ||
'@PHP71Migration' => true, | ||
'array_syntax' => array('syntax' => 'short'), | ||
'combine_consecutive_unsets' => true, | ||
'declare_strict_types' => true, | ||
'header_comment' => ['header' => $header], | ||
'heredoc_to_nowdoc' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'no_extra_consecutive_blank_lines' => ['continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'], | ||
'no_short_echo_tag' => true, | ||
'no_unreachable_default_argument_value' => false, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => false, | ||
'ordered_imports' => true, | ||
'phpdoc_add_missing_param_annotation' => false, | ||
'phpdoc_annotation_without_dot' => true, | ||
'phpdoc_no_empty_return' => false, // PHP 7 compatibility | ||
'phpdoc_order' => true, | ||
// This breaks for variable @var blocks | ||
'phpdoc_to_comment' => false, | ||
'phpdoc_var_without_name' => false, | ||
'semicolon_after_instruction' => true, | ||
'single_import_per_statement' => false, | ||
'strict_comparison' => false, | ||
'strict_param' => true, | ||
// Breaks with phpstan | ||
'phpdoc_inline_tag' => false, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->exclude('Fixtures') | ||
->in([__DIR__.'/src', __DIR__.'/tests']) | ||
) | ||
; |
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
parameters: | ||
autoload_files: | ||
- vendor/autoload.php | ||
ignoreErrors: | ||
#- '#__construct\(\) does not call parent constructor from .+#' | ||
|
||
# ValueHolder guard there own correctness. A ValuesBag never returns a wrong object (collection). | ||
- '#expects Rollerworks\\Component\\Search\\Value\\[a-zA-Z]+\[\], Rollerworks\\Component\\Search\\Value\\ValueHolder\[\] given#' | ||
# - '#Call to an undefined method Rollerworks\\Component\\Search\\Value\\ValueHolder\:\:#' | ||
|
||
# False positive | ||
- '#Call to an undefined method Doctrine\\DBAL\\Driver\\Connection\:\:sqliteCreateFunction\(\)#' | ||
- '#Parameter \#2 \$type of method Doctrine\\DBAL\\Connection\:\:quote\(\) expects ([^\s]+)#' | ||
- "#Casting to string something that's already string#" # cannot fix this yet. | ||
- '#(DbalTestCase|FunctionalDbalTestCase|SearchIntegrationTestCase) not found and could not be autoloaded#' # properly a bug in PHPStan? | ||
|
||
# Tests | ||
# - '#Call to an undefined method Prophecy\\Prophecy\\ObjectProphecy::[a-zA-Z0-9_]+\(\)#' | ||
# - '#Access to an undefined property Prophecy\\Prophecy\\ObjectProphecy::\$[a-zA-Z0-9_]+#' | ||
# - '#Call to an undefined method PHPUnit_Framework_MockObject_MockObject::[a-zA-Z0-9_]+\(\)#' | ||
# - '#expects\s+[^\s]+, PHPUnit_Framework_MockObject_MockObject(\[\])? given#' | ||
# - '#does not accept PHPUnit_Framework_MockObject_MockObject#' | ||
# - '#but returns PHPUnit_Framework_MockObject_MockObject#' | ||
# - '#Call to an undefined static method Money\\Money\:\:#' |
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
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