Skip to content

Commit ab9eb19

Browse files
committed
Updated dependencies
1 parent 69cae8f commit ab9eb19

File tree

4 files changed

+21
-32
lines changed

4 files changed

+21
-32
lines changed

SlevomatCodingStandard/Helpers/TokenHelper.php

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ class TokenHelper
5050
*/
5151
public static function findNext(\PHP_CodeSniffer_File $phpcsFile, $types, int $startPointer, int $endPointer = null)
5252
{
53+
/** @var int|false $token */
5354
$token = $phpcsFile->findNext($types, $startPointer, $endPointer, false);
54-
if ($token === false) {
55-
return null;
56-
}
57-
return $token;
55+
return $token === false ? null : $token;
5856
}
5957

6058
/**
@@ -67,11 +65,9 @@ public static function findNext(\PHP_CodeSniffer_File $phpcsFile, $types, int $s
6765
*/
6866
public static function findNextContent(\PHP_CodeSniffer_File $phpcsFile, $types, string $content, int $startPointer, int $endPointer = null)
6967
{
68+
/** @var int|false $token */
7069
$token = $phpcsFile->findNext($types, $startPointer, $endPointer, false, $content);
71-
if ($token === false) {
72-
return null;
73-
}
74-
return $token;
70+
return $token === false ? null : $token;
7571
}
7672

7773
/**
@@ -94,11 +90,9 @@ public static function findNextEffective(\PHP_CodeSniffer_File $phpcsFile, int $
9490
*/
9591
public static function findNextExcluding(\PHP_CodeSniffer_File $phpcsFile, $types, int $startPointer, int $endPointer = null)
9692
{
93+
/** @var int|false $token */
9794
$token = $phpcsFile->findNext($types, $startPointer, $endPointer, true);
98-
if ($token === false) {
99-
return null;
100-
}
101-
return $token;
95+
return $token === false ? null : $token;
10296
}
10397

10498
/**
@@ -110,11 +104,9 @@ public static function findNextExcluding(\PHP_CodeSniffer_File $phpcsFile, $type
110104
*/
111105
public static function findNextLocal(\PHP_CodeSniffer_File $phpcsFile, $types, int $startPointer, int $endPointer = null)
112106
{
107+
/** @var int|false $token */
113108
$token = $phpcsFile->findNext($types, $startPointer, $endPointer, false, null, true);
114-
if ($token === false) {
115-
return null;
116-
}
117-
return $token;
109+
return $token === false ? null : $token;
118110
}
119111

120112
/**
@@ -126,11 +118,9 @@ public static function findNextLocal(\PHP_CodeSniffer_File $phpcsFile, $types, i
126118
*/
127119
public static function findNextLocalExcluding(\PHP_CodeSniffer_File $phpcsFile, $types, int $startPointer, int $endPointer = null)
128120
{
121+
/** @var int|false $token */
129122
$token = $phpcsFile->findNext($types, $startPointer, $endPointer, true, null, true);
130-
if ($token === false) {
131-
return null;
132-
}
133-
return $token;
123+
return $token === false ? null : $token;
134124
}
135125

136126
/**
@@ -153,11 +143,9 @@ public static function findNextAnyToken(\PHP_CodeSniffer_File $phpcsFile, int $s
153143
*/
154144
public static function findPrevious(\PHP_CodeSniffer_File $phpcsFile, $types, int $startPointer, int $endPointer = null)
155145
{
146+
/** @var int|false $token */
156147
$token = $phpcsFile->findPrevious($types, $startPointer, $endPointer, false);
157-
if ($token === false) {
158-
return null;
159-
}
160-
return $token;
148+
return $token === false ? null : $token;
161149
}
162150

163151
/**
@@ -180,11 +168,9 @@ public static function findPreviousEffective(\PHP_CodeSniffer_File $phpcsFile, i
180168
*/
181169
public static function findPreviousExcluding(\PHP_CodeSniffer_File $phpcsFile, $types, int $startPointer, int $endPointer = null)
182170
{
171+
/** @var int|false $token */
183172
$token = $phpcsFile->findPrevious($types, $startPointer, $endPointer, true);
184-
if ($token === false) {
185-
return null;
186-
}
187-
return $token;
173+
return $token === false ? null : $token;
188174
}
189175

190176
/**

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
>
9191
<arg value="analyse"/>
9292
<arg value="-l"/>
93-
<arg value="5"/>
93+
<arg value="6"/>
9494
<arg value="-c"/>
9595
<arg path="build/phpstan.neon"/>
9696
<arg path="SlevomatCodingStandard"/>

build/phpstan.neon

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
parameters:
2+
autoload_files:
3+
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php
24
excludes_analyse:
35
- */tests/*/data/*
4-
enableUnionTypes: false
6+
ignoreErrors:
7+
- '~Parameter #2 \$array of method PHPUnit\\Framework\\Assert::assertArrayHasKey\(\)~'

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"require-dev": {
1515
"jakub-onderka/php-parallel-lint": "0.9.2",
1616
"phing/phing": "2.16",
17-
"phpstan/phpstan": "0.6.4",
18-
"phpunit/phpunit": "6.1.2"
17+
"phpstan/phpstan": "0.7.0",
18+
"phpunit/phpunit": "6.2.2"
1919
},
2020
"autoload": {
2121
"psr-4": {

0 commit comments

Comments
 (0)