Skip to content

Commit

Permalink
Merge pull request #95 from stronk7/php-cs-fixer-bump-219
Browse files Browse the repository at this point in the history
Bump php-cs-fixer to v2.19.0
  • Loading branch information
kabalin authored May 10, 2021
2 parents b62ba3f + b618c4d commit 25dc417
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
20 changes: 15 additions & 5 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,44 @@
License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
EOF;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'combine_consecutive_issets' => true,
'general_phpdoc_annotation_remove' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'],
'general_phpdoc_annotation_remove' => ['annotations' => [
'expectedException',
'expectedExceptionMessage',
'expectedExceptionMessageRegExp',
]],
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => true,
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
'no_short_echo_tag' => true,
'no_extra_blank_lines' => ['tokens' => [
'break', 'continue', 'extra', 'return',
'throw', 'use', 'parenthesis_brace_block',
'square_brace_block', 'curly_brace_block',
]],
'echo_tag_syntax' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_add_missing_param_annotation' => true,
'no_superfluous_phpdoc_tags' => false,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
'binary_operator_spaces' => ['align_equals' => true, 'align_double_arrow' => true],
'binary_operator_spaces' => ['operators' => ['=' => 'align', '=>' => 'align']],
'align_multiline_comment' => true,
'yoda_style' => false,
'compact_nullable_typehint' => true,
'native_function_invocation' => false,
'native_constant_invocation' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ endif

# Update download URL from https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases
build/php-cs-fixer.phar:
curl -LSs https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.14.2/php-cs-fixer.phar -o build/php-cs-fixer.phar
curl -LSs https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.19.0/php-cs-fixer.phar -o build/php-cs-fixer.phar

# Update download URL from https://github.com/vimeo/psalm/releases
build/psalm.phar:
Expand Down
2 changes: 1 addition & 1 deletion bin/moodle-plugin-ci
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (file_exists(__DIR__.'/../../../autoload.php')) {
require_once __DIR__.'/../vendor/autoload.php';
} else {
fwrite(STDERR, 'Failed to find Composer\'s autoload file. You might need to run Composer\'s install on this project'.PHP_EOL);
die(1);
exit(1);
}

define('MOODLE_PLUGIN_CI_BOXED', '@is_boxed@');
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/SavePointsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class SavePointsCommandTest extends MoodleTestCase
{
public function setUp()
protected function setUp()
{
parent::setUp();
}
Expand Down

0 comments on commit 25dc417

Please sign in to comment.