correct use of type and argument collections
This commit is contained in:
@@ -219,12 +219,7 @@ class TheliaLoop implements SmartyPluginInterface
|
|||||||
$faultDetails = array();
|
$faultDetails = array();
|
||||||
|
|
||||||
$argumentsCollection = $loop->defineArgs();
|
$argumentsCollection = $loop->defineArgs();
|
||||||
$argumentsCollection->rewind();
|
foreach( $argumentsCollection as $argument ) {
|
||||||
|
|
||||||
while ($argumentsCollection->valid()) {
|
|
||||||
|
|
||||||
$argument = $argumentsCollection->current();
|
|
||||||
$argumentsCollection->next();
|
|
||||||
|
|
||||||
$value = isset($smartyParam[$argument->name]) ? $smartyParam[$argument->name] : null;
|
$value = isset($smartyParam[$argument->name]) ? $smartyParam[$argument->name] : null;
|
||||||
|
|
||||||
|
|||||||
@@ -124,15 +124,10 @@ class TypeCollection implements \Iterator
|
|||||||
*/
|
*/
|
||||||
public function isValid($value)
|
public function isValid($value)
|
||||||
{
|
{
|
||||||
$this->rewind();
|
foreach($this as $type) {
|
||||||
while ($this->valid()) {
|
|
||||||
$type = $this->current();
|
|
||||||
|
|
||||||
if($type->isValid($value)) {
|
if($type->isValid($value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->next();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user