Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

feat(cs) Add PHP 7.* rules #48

Merged
merged 3 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Bin/Cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public function main()
$arguments[] = '--diff';
}

$arguments['--allow-risky'] = 'yes';

$arguments[] = $path;

$processus = new Console\Processus($phpCsFixer, $arguments);
Expand Down
17 changes: 12 additions & 5 deletions Resource/PHPCSFixer/ConfigurationFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,25 @@
return
$out->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['align_double_arrow' => true, 'align_equals' => true],
'blank_line_after_opening_tag' => true,
'cast_spaces' => true,
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'no_blank_lines_after_class_opening' => true,
'ordered_imports' => true,
'phpdoc_no_access' => true,
'no_leading_import_slash' => true,
'self_accessor' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'phpdoc_no_access' => true,
'pow_to_exponentiation' => true,
'random_api_migration' => true,
'return_type_declaration' => ['space_before' => 'none'],
'self_accessor' => true,
'ternary_to_null_coalescing' => true,
'visibility_required' => ['elements' => ['const', 'property', 'method']],
'void_return' => true,

// Hoa defined
'Hoa/author' => true,
Expand Down
6 changes: 1 addition & 5 deletions Resource/PHPCSFixer/Fixer/Copyright.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ function ($matches) use ($thisYear) {
}

foreach ($annotations as $annotation) {
$line = $docBlock->getLine($annotation->getStart());
$line->setContent(
' * @copyright Copyright © 2007-' . $thisYear .
' Hoa community' . "\n"
);
$annotation->remove();
}

$token->setContent($docBlock->getContent());
Expand Down