correct use of type and argument collections

This commit is contained in:
Etienne Roudeix
2013-06-25 08:55:08 +02:00
parent 94586c3a9c
commit 0be18e763a
2 changed files with 2 additions and 12 deletions

View File

@@ -219,12 +219,7 @@ class TheliaLoop implements SmartyPluginInterface
$faultDetails = array();
$argumentsCollection = $loop->defineArgs();
$argumentsCollection->rewind();
while ($argumentsCollection->valid()) {
$argument = $argumentsCollection->current();
$argumentsCollection->next();
foreach( $argumentsCollection as $argument ) {
$value = isset($smartyParam[$argument->name]) ? $smartyParam[$argument->name] : null;

View File

@@ -124,15 +124,10 @@ class TypeCollection implements \Iterator
*/
public function isValid($value)
{
$this->rewind();
while ($this->valid()) {
$type = $this->current();
foreach($this as $type) {
if($type->isValid($value)) {
return true;
}
$this->next();
}
return false;