Skip to content

Commit

Permalink
fix(saveObjects-error-msg): fix PR
Browse files Browse the repository at this point in the history
  • Loading branch information
chloelbn committed Feb 6, 2020
1 parent 53bbe87 commit 57dc870
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/Exceptions/InvalidArgumentObjectsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

namespace Algolia\AlgoliaSearch\Exceptions;

use Throwable;

final class InvalidArgumentObjectsException extends AlgoliaException
{
/**
* InvalidArgumentObjectsException constructor.
*
* @param string $message The Exception message to throw
* @param int $code The Exception code
* @param Throwable $previous The previous throwable used for the exception chaining
*/
public function __construct($message = '', $code = 0, $previous = null)
{
if (!$message) {
if ('' === $message) {
$message = 'Please provide an array of objects instead of a single object.';
}

Expand Down
2 changes: 1 addition & 1 deletion src/Support/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@ public static function mapObjectIDs($objectIDKey, $objects)
*/
public static function isIterable($object)
{
return is_array($object) || is_object($object) || $object instanceof \Traversable;
return is_array($object) || $object instanceof \Traversable;
}
}

0 comments on commit 57dc870

Please sign in to comment.