예제 #1
0
 public function setUp()
 {
     \Colada\Colada::registerFunctions();
 }
예제 #2
0
<?php

namespace Colada;

use Colada\Helpers\TypeHelper;
Colada::registerFunctions();
/**
 * General purpose collection implementation.
 *
 * @author Alexey Shockov <*****@*****.**>
 */
class IteratorCollection implements \Countable, \IteratorAggregate, Collection
{
    /**
     * @var \Iterator
     */
    protected $iterator;
    /**
     * @throws \InvalidArgumentException For \NoRewindIterator iterators.
     *
     * @param \Traversable $collection
     */
    public function __construct(\Traversable $collection = null)
    {
        if ($collection instanceof \IteratorAggregate) {
            $collection = $collection->getIterator();
        }
        // Traversable?
        if (!$collection instanceof \Iterator && !$collection instanceof \IteratorAggregate) {
            $collection = new \IteratorIterator($collection);
        }
예제 #3
0
function use_colada()
{
    require_once __DIR__ . '/globals.php';
    \Colada\Colada::registerFunctions();
}