Skip to content

Commit 302cbba

Browse files
authored
Fix a potential notice
If `$sniffName` key does not exist, t would raise the "undefined index" notice.
1 parent 98cab36 commit 302cbba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Sniffs.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,9 @@ class Sniffs
172172
public static function pointsFor($issue)
173173
{
174174
$sniffName = $issue["source"];
175-
$points = self::$sniffs[$sniffName];
176175

177-
if ($points) {
178-
return $points;
176+
if (array_key_exists($sniffName, self::$sniffs)) {
177+
return self::$sniffs[$sniffName];
179178
} else {
180179
return $issue["severity"] * self::DEFAULT_POINTS;
181180
}

0 commit comments

Comments
 (0)