Author: voxus
Date: 2005-08-14 21:13:37 +0400 (Sun, 14 Aug 2005)
New Revision: 737
Modified:
src/classes/Utils/ArrayUtils.class.php
Log:
* lazy sanity check
Modified: src/classes/Utils/ArrayUtils.class.php
===================================================================
--- src/classes/Utils/ArrayUtils.class.php 2005-08-14 16:19:03 UTC (rev 736)
+++ src/classes/Utils/ArrayUtils.class.php 2005-08-14 17:13:37 UTC (rev 737)
@@ -28,13 +28,15 @@
public static function &getIdsArray(&$objectsList)
{
+ Assert::isTrue(
+ current($objectsList) instanceof Identifiable,
+ 'only identifiable lists accepted'
+ );
+
$out = array();
foreach ($objectsList as &$object)
- if ($object instanceof Identifiable)
- $out[] = $object->getId();
- else
- throw new WrongArgumentException('only identifiable lists accepted');
+ $out[] = $object->getId();
return $out;
}
Received on Sun Aug 14 2005 - 21:13:38 MSD
This archive was generated by hypermail 2.2.0 : Sat Oct 27 2007 - 19:31:08 MSD