Skip to content

Commit 1e781bd

Browse files
IN-1729 - Autofix code style errors
1 parent b1e9ac7 commit 1e781bd

File tree

12 files changed

+32
-27
lines changed

12 files changed

+32
-27
lines changed

custom-standards/Flyeralarm/Sniffs/Classes/FullyQualifiedSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class FullyQualifiedSniff implements Sniff
1313
*/
1414
public function register()
1515
{
16-
return array(T_DOUBLE_COLON, T_NEW, T_EXTENDS, T_IMPLEMENTS);
16+
return [T_DOUBLE_COLON, T_NEW, T_EXTENDS, T_IMPLEMENTS];
1717
}
1818

1919
/**

custom-standards/Flyeralarm/Sniffs/ControlStructures/YodaSniff.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class YodaSniff implements Sniff
1212
*/
1313
public function register()
1414
{
15-
return array(T_IF, T_ELSEIF, T_WHILE);
15+
return [T_IF, T_ELSEIF, T_WHILE];
1616
}
1717

1818
/**
@@ -87,21 +87,25 @@ private function checkConditionalOrderForArithmeticExpression(
8787

8888
// e.g. if ($foo = true)
8989
// e.g. if ($foo = 'bar')
90-
if (in_array($leftOperandTokenId, $functionAndVariableTokenIds)
90+
if (
91+
in_array($leftOperandTokenId, $functionAndVariableTokenIds)
9192
&& in_array($rightOperandTokenId, $languageTypeTokenIds)
9293
) {
9394
return;
9495
}
9596
// e.g. if (count(..) > $test)
9697
// e.g. if ($foo == $bar)
97-
if (in_array($leftOperandTokenId, $functionAndVariableTokenIds)
98+
if (
99+
in_array($leftOperandTokenId, $functionAndVariableTokenIds)
98100
&& in_array($rightOperandTokenId, $functionAndVariableTokenIds)
99101
) {
100102
return;
101103
}
102104
// e.g. if ('foo' == 'bar')
103-
if (in_array($leftOperandTokenId, $languageTypeTokenIds)
104-
&& in_array($rightOperandTokenId, $languageTypeTokenIds)) {
105+
if (
106+
in_array($leftOperandTokenId, $languageTypeTokenIds)
107+
&& in_array($rightOperandTokenId, $languageTypeTokenIds)
108+
) {
105109
return;
106110
}
107111

custom-standards/Flyeralarm/Sniffs/Docblock/ExpectedExceptionMessageSniff.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ExpectedExceptionMessageSniff implements Sniff
1212
*/
1313
public function register()
1414
{
15-
return array(T_DOC_COMMENT_OPEN_TAG);
15+
return [T_DOC_COMMENT_OPEN_TAG];
1616
}
1717

1818
/**
@@ -25,8 +25,10 @@ public function process(File $phpcsFile, $stackPtr)
2525
if (!$this->hasAnnotationInDoc($phpcsFile, $stackPtr, '@expectedException')) {
2626
return;
2727
}
28-
if ($this->hasAnnotationInDoc($phpcsFile, $stackPtr, '@expectedExceptionMessage')
29-
|| $this->hasAnnotationInDoc($phpcsFile, $stackPtr, '@expectedExceptionMessageRegExp')) {
28+
if (
29+
$this->hasAnnotationInDoc($phpcsFile, $stackPtr, '@expectedExceptionMessage')
30+
|| $this->hasAnnotationInDoc($phpcsFile, $stackPtr, '@expectedExceptionMessageRegExp')
31+
) {
3032
return;
3133
}
3234

custom-standards/Flyeralarm/Sniffs/File/ExceptionMessageSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ExceptionMessageSniff implements Sniff
1212
*/
1313
public function register()
1414
{
15-
return array(T_CLASS);
15+
return [T_CLASS];
1616
}
1717

1818
/**
@@ -31,7 +31,7 @@ public function process(File $phpcsFile, $stackPtr)
3131

3232
$tokens = $phpcsFile->getTokens();
3333
$ptr = -1;
34-
while($ptr = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, $ptr + 1)) {
34+
while ($ptr = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, $ptr + 1)) {
3535
if (strpos($tokens[$ptr]['content'], '!') !== false) {
3636
$phpcsFile->addError(
3737
'Exclamationmarks are not allowed in Exceptionmessages',

custom-standards/Flyeralarm/Sniffs/File/ForbiddenKeywordsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ForbiddenKeywordsSniff implements Sniff
1212
*/
1313
public function register()
1414
{
15-
return array(T_CLASS, T_ABSTRACT, T_TRAIT);
15+
return [T_CLASS, T_ABSTRACT, T_TRAIT];
1616
}
1717

1818
/**

custom-standards/Flyeralarm/Sniffs/File/NamespacesSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NamespacesSniff implements Sniff
1212
*/
1313
public function register()
1414
{
15-
return array(T_CLASS, T_ABSTRACT, T_TRAIT, T_INTERFACE);
15+
return [T_CLASS, T_ABSTRACT, T_TRAIT, T_INTERFACE];
1616
}
1717

1818
/**
@@ -24,7 +24,7 @@ public function process(File $phpcsFile, $stackPtr)
2424
{
2525
$tokens = $phpcsFile->getTokens();
2626
$ptr = -1;
27-
while($ptr = $phpcsFile->findNext(T_NS_SEPARATOR, $ptr + 1)) {
27+
while ($ptr = $phpcsFile->findNext(T_NS_SEPARATOR, $ptr + 1)) {
2828
if (strpos($tokens[$ptr + 1]['content'], '_') !== false) {
2929
$phpcsFile->addError(
3030
'Using underscore within namespaces is discouraged',

custom-standards/Flyeralarm/Sniffs/File/NoClassKindSuffixSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NoClassKindSuffixSniff implements Sniff
1212
*/
1313
public function register()
1414
{
15-
return array(T_INTERFACE, T_CLASS, T_TRAIT);
15+
return [T_INTERFACE, T_CLASS, T_TRAIT];
1616
}
1717

1818
/**

custom-standards/Flyeralarm/Sniffs/Variable/LowerCamelCaseSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LowerCamelCaseSniff implements Sniff
2828
*/
2929
public function register()
3030
{
31-
return array(T_OPEN_TAG);
31+
return [T_OPEN_TAG];
3232
}
3333

3434
/**
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
// @expectedPass
34

45
$array = [];

tests/rules/classes/allowed/LowercaseNamespaceCapitalization.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66

77
class LowercaseNamespaceCapitalization
88
{
9-
109
}

0 commit comments

Comments
 (0)