mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Foreach props, range iterator and more
This commit is contained in:
@@ -284,10 +284,13 @@ class Modifier
|
||||
* @param string|int $from
|
||||
* @param string|int $to
|
||||
* @param int $step
|
||||
* @return array
|
||||
* @return RangeIterator
|
||||
*/
|
||||
public static function range($from, $to, $step = 1) {
|
||||
$v = range($from, $to, $step);
|
||||
return $v ? $v : array();
|
||||
if($from instanceof RangeIterator) {
|
||||
return $from->setStep($to);
|
||||
} else {
|
||||
return new RangeIterator($from, $to, $step);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user