Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[#5364] Incorporate feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jan 3, 2014
1 parent 4569ab9 commit c749ec4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion library/Zend/Stdlib/Guard/ArrayOrTraversableGuardTrait.php
Expand Up @@ -9,6 +9,8 @@

namespace Zend\Stdlib\Guard;

use Traversable;

/**
* Provide a guard method for array or Traversable data
*/
Expand All @@ -28,7 +30,7 @@ protected function guardForArrayOrTraversable(
$dataName = 'Argument',
$exceptionClass = 'Zend\Stdlib\Exception\InvalidArgumentException'
) {
if (!is_array($data) && !($data instanceof \Traversable)) {
if (!is_array($data) && !($data instanceof Traversable)) {
$message = sprintf(
"%s must be an array or Traversable, [%s] given",
$dataName,
Expand Down
6 changes: 4 additions & 2 deletions library/Zend/Stdlib/Guard/GuardUtils.php
Expand Up @@ -9,6 +9,8 @@

namespace Zend\Stdlib\Guard;

use Traversable;

/**
* Static guard helper class
*
Expand All @@ -35,7 +37,7 @@ public static function guardForArrayOrTraversable(
$dataName = 'Argument',
$exceptionClass = self::DEFAULT_EXCEPTION_CLASS
) {
if (!is_array($data) && !($data instanceof \Traversable)) {
if (!is_array($data) && !($data instanceof Traversable)) {
$message = sprintf(
'%s must be an array or Traversable, [%s] given',
$dataName,
Expand Down Expand Up @@ -77,7 +79,7 @@ public static function guardAgainstNull(
$dataName = 'Argument',
$exceptionClass = self::DEFAULT_EXCEPTION_CLASS
) {
if (is_null($data)) {
if (null === $data) {
$message = sprintf('%s cannot be null', $dataName);
throw new $exceptionClass($message);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Stdlib/Guard/NullGuardTrait.php
Expand Up @@ -28,7 +28,7 @@ protected function guardAgainstNull(
$dataName = 'Argument',
$exceptionClass = 'Zend\Stdlib\Exception\InvalidArgumentException'
) {
if (is_null($data)) {
if (null === $data) {
$message = sprintf('%s cannot be null', $dataName);
throw new $exceptionClass($message);
}
Expand Down

0 comments on commit c749ec4

Please sign in to comment.