Skip to content

Commit 26fd135

Browse files
author
Vincent Langlet
committed
💄 Respect linter
1 parent 28b0d1a commit 26fd135

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Symfony3Custom/Sniffs/Formatting/BlankLineBeforeReturnSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
3636
$prevLineTokens = array();
3737

3838
while ($current >= 0 && $tokens[$current]['line'] >= $previousLine) {
39-
if ($tokens[$current]['line'] == $previousLine
39+
if ($tokens[$current]['line'] === $previousLine
4040
&& 'T_WHITESPACE' !== $tokens[$current]['type']
4141
&& 'T_COMMENT' !== $tokens[$current]['type']
4242
&& 'T_DOC_COMMENT_CLOSE_TAG' !== $tokens[$current]['type']
@@ -62,7 +62,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
6262
if (true === $fix) {
6363
$phpcsFile->fixer->beginChangeset();
6464
$i = 1;
65-
while ('T_WHITESPACE' == $tokens[$stackPtr - $i]['type']) {
65+
while ('T_WHITESPACE' === $tokens[$stackPtr - $i]['type']) {
6666
$i++;
6767
}
6868
$phpcsFile->fixer->addNewLine($stackPtr - $i);

Symfony3Custom/Sniffs/NamingConventions/ValidClassNameSniff.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
3434
$tokens = $phpcsFile->getTokens();
3535
$line = $tokens[$stackPtr]['line'];
3636

37-
while ($tokens[$stackPtr]['line'] == $line) {
37+
while ($tokens[$stackPtr]['line'] === $line) {
3838
/*
3939
* Suffix interfaces with Interface;
4040
*/
41-
if ('T_INTERFACE' == $tokens[$stackPtr]['type']) {
41+
if ('T_INTERFACE' === $tokens[$stackPtr]['type']) {
4242
$name = $phpcsFile->findNext(T_STRING, $stackPtr);
4343

44-
if ($name && substr($tokens[$name]['content'], -9) != 'Interface') {
44+
if ($name && substr($tokens[$name]['content'], -9) !== 'Interface') {
4545
$phpcsFile->addError(
4646
'Interface name is not suffixed with "Interface"',
4747
$stackPtr,
@@ -54,10 +54,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
5454
/*
5555
* Suffix traits with Trait;
5656
*/
57-
if ('T_TRAIT' == $tokens[$stackPtr]['type']) {
57+
if ('T_TRAIT' === $tokens[$stackPtr]['type']) {
5858
$name = $phpcsFile->findNext(T_STRING, $stackPtr);
5959

60-
if ($name && substr($tokens[$name]['content'], -5) != 'Trait') {
60+
if ($name && substr($tokens[$name]['content'], -5) !== 'Trait') {
6161
$phpcsFile->addError(
6262
'Trait name is not suffixed with "Trait"',
6363
$stackPtr,
@@ -70,17 +70,17 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
7070
/*
7171
* Suffix exceptions with Exception;
7272
*/
73-
if ('T_EXTENDS' == $tokens[$stackPtr]['type']) {
73+
if ('T_EXTENDS' === $tokens[$stackPtr]['type']) {
7474
$extend = $phpcsFile->findNext(T_STRING, $stackPtr);
7575

7676
if ($extend
77-
&& substr($tokens[$extend]['content'], -9) == 'Exception'
77+
&& substr($tokens[$extend]['content'], -9) === 'Exception'
7878
) {
7979
$class = $phpcsFile->findPrevious(T_CLASS, $stackPtr);
8080
$name = $phpcsFile->findNext(T_STRING, $class);
8181

8282
if ($name
83-
&& substr($tokens[$name]['content'], -9) != 'Exception'
83+
&& substr($tokens[$name]['content'], -9) !== 'Exception'
8484
) {
8585
$phpcsFile->addError(
8686
'Exception name is not suffixed with "Exception"',
@@ -95,13 +95,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
9595
/*
9696
* Prefix abstract classes with Abstract.
9797
*/
98-
if ('T_ABSTRACT' == $tokens[$stackPtr]['type']) {
98+
if ('T_ABSTRACT' === $tokens[$stackPtr]['type']) {
9999
$name = $phpcsFile->findNext(T_STRING, $stackPtr);
100100
$function = $phpcsFile->findNext(T_FUNCTION, $stackPtr);
101101

102102
// Making sure we're not dealing with an abstract function
103103
if ($name && (false === $function || $name < $function)
104-
&& substr($tokens[$name]['content'], 0, 8) != 'Abstract'
104+
&& substr($tokens[$name]['content'], 0, 8) !== 'Abstract'
105105
) {
106106
$phpcsFile->addError(
107107
'Abstract class name is not prefixed with "Abstract"',

0 commit comments

Comments
 (0)