Skip to content

Commit

Permalink
throw an exception when variable passed to Doctrine_Collection::compa…
Browse files Browse the repository at this point in the history
…reRecords is not an object fix
  • Loading branch information
marcing committed May 8, 2014
1 parent 98f1100 commit 26055e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,11 @@ protected function compareRecords($a, $b)
{
if(!$a instanceof Doctrine_Record)
{
throw new Doctrine_Collection_Exception('Doctrine_Record expected, %s given.', is_object($a) ? get_class($a) : gettype($a));
throw new Doctrine_Collection_Exception(sprintf('Doctrine_Record expected, %s given.', is_object($a) ? get_class($a) : gettype($a)));
}
if(!$b instanceof Doctrine_Record)
{
throw new Doctrine_Collection_Exception('Doctrine_Record expected, %s given.', is_object($b) ? get_class($b) : gettype($b));
throw new Doctrine_Collection_Exception(sprintf('Doctrine_Record expected, %s given.', is_object($b) ? get_class($b) : gettype($b)));
}

if ($a->getOid() == $b->getOid()) {
Expand Down

0 comments on commit 26055e2

Please sign in to comment.