Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Slevomat CS #183

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: php

php:
- 5.6 # security support until 31/12/2018
- 7.0 # security support until 03/12/2018
- 7.1 # security support until 01/12/2019
- 7.2 # security support until 30/11/2020
- 7.3 # security support until 06/12/2021
- 7.4 # security support until 28/11/2022
Expand Down
8 changes: 5 additions & 3 deletions Symfony/Sniffs/Arrays/MultiLineArrayCommaSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ public function process(File $phpcsFile, $stackPtr)
while ($lastCommaPtr < $closePtr -1) {
$lastCommaPtr++;

if ($tokens[$lastCommaPtr]['code'] !== T_WHITESPACE
&& $tokens[$lastCommaPtr]['code'] !== T_PHPCS_IGNORE
&& $tokens[$lastCommaPtr]['code'] !== T_COMMENT
if (!in_array(
$tokens[$lastCommaPtr]['code'],
[T_WHITESPACE, T_PHPCS_IGNORE, T_COMMENT],
true
)
) {
$fix = $phpcsFile->addFixableError(
'Add a comma after each item in a multi-line array',
Expand Down
5 changes: 1 addition & 4 deletions Symfony/Sniffs/Classes/PropertyDeclarationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();

$end = null;
if (isset($tokens[$stackPtr]['scope_closer'])) {
$end = $tokens[$stackPtr]['scope_closer'];
}
$end = $tokens[$stackPtr]['scope_closer'] ?? null;

$scope = $phpcsFile->findNext(
T_FUNCTION,
Expand Down
2 changes: 1 addition & 1 deletion Symfony/Sniffs/Commenting/AnnotationsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
class AnnotationsSniff implements Sniff
{
const PATTERN = '/^@([^\\\(]+).*$/i';
private const PATTERN = '/^@([^\\\(]+).*$/i';

/**
* Registers the tokens that this sniff wants to listen for.
Expand Down
138 changes: 0 additions & 138 deletions Symfony/Sniffs/Commenting/TypeHintingSniff.php

This file was deleted.

66 changes: 0 additions & 66 deletions Symfony/Sniffs/ControlStructure/IdenticalComparisonSniff.php

This file was deleted.

97 changes: 0 additions & 97 deletions Symfony/Sniffs/ControlStructure/YodaConditionsSniff.php

This file was deleted.

Loading