Skip to content

Commit

Permalink
Changed the OutOfBounds exceptions when getting a property
Browse files Browse the repository at this point in the history
They aren't variables but keys in the $properties array.
Thus the old error message was misleading.
  • Loading branch information
ravage84 committed Oct 8, 2014
1 parent e8c3f53 commit 0dad28d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/php/PHPMD/AbstractRule.php
Expand Up @@ -361,7 +361,7 @@ public function getBooleanProperty($name)
if (isset($this->properties[$name])) {
return in_array($this->properties[$name], array('true', 'on', 1));
}
throw new \OutOfBoundsException('Property $' . $name . ' does not exist.');
throw new \OutOfBoundsException('Property "' . $name . '" does not exist.');
}

/**
Expand All @@ -377,7 +377,7 @@ public function getIntProperty($name)
if (isset($this->properties[$name])) {
return (int) $this->properties[$name];
}
throw new \OutOfBoundsException('Property $' . $name . ' does not exist.');
throw new \OutOfBoundsException('Property "' . $name . '" does not exist.');
}


Expand All @@ -394,7 +394,7 @@ public function getStringProperty($name)
if (isset($this->properties[$name])) {
return $this->properties[$name];
}
throw new \OutOfBoundsException('Property $' . $name . ' does not exist.');
throw new \OutOfBoundsException('Property "' . $name . '" does not exist.');

}

Expand Down

0 comments on commit 0dad28d

Please sign in to comment.