Load fixtures from files contained in iterator.

@param \Iterator $iterator Iterator over files from which fixtures should be loaded.

@return Neo4jFixtureInterface[] $fixtures Array of loaded fixture object instances.
197797
private function loadFromIterator(\Iterator $iterator)
    {
        $includedFiles = [];

        foreach ($iterator as $file) {
            if (($fileName = $file->getBasename($this->fileExtension)) == $file->getBasename()) {
                continue;
            }

            $sourceFile = realpath($file->getPathName());
            require_once $sourceFile;
            $includedFiles[] = $sourceFile;
        }

        $fixtures = [];
        $declared = get_declared_classes();

        foreach ($declared as $className) {
            $reflClass = new \ReflectionClass($className);
            $sourceFile = $reflClass->getFileName();

            if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) {
                $fixture = new $className();
                $fixtures[] = $fixture;
                $this->addFixture($fixture);
            }
        }

        return $fixtures;
    }
1012799
public function load(array $fixturesFiles, array $parameters = [], array $objects = [], PurgeMode $purgeMode = null): array
    {
        $this->logger->info('Resolving fixture files.');

        $fixturesFiles = $this->fileResolver->resolve($fixturesFiles);

        return $this->loader->load($fixturesFiles, $parameters, $objects, $purgeMode);
    }
689797
private function fetchFixtures()
    {
        $this->loader = $this->getFixtureLoader();

        $bundleDirectories = $this->autoload ? $this->getBundleFixtureDirectories() : array();

        $this->fetchFixturesFromDirectories($bundleDirectories);
        $this->fetchFixturesFromDirectories($this->directories ?: array());
        $this->fetchFixturesFromClasses($this->fixtures ?: array());

        return $this->loader->getFixtures();
    }
987335
public function getChildren(): \RecursiveIterator {
        $nodes = [];

        if ($this->valid()) {
            $nodes = $this->current()->childNodes;
        }

        return new static($nodes);
    }
489831
public function getFixture(string $name): Fixture
    {
        if ($this->_fixtures === null) {
            $this->_fixtures = $this->createFixtures($this->fixtures());
        }

        $name = ltrim($name, '\\');

        return $this->_fixtures[$name] ?? null;
    }
341607
public function groupBy($iterator) : Collection
    {
        $rslt = [];
        $temp = $this->toArray();
        foreach ($temp as $k => $v) {
            $rslt[is_string($iterator) ? (is_object($v) ? $v->{$iterator} : $v[$iterator]) : call_user_func($iterator, $v, $k)][] = $v;
        }
        return new static($rslt);
    }
424246
public function addFixture(Neo4jFixtureInterface $fixture)
    {
        $fixtureClass = get_class($fixture);

        if (isset($this->fixtures[$fixtureClass])) {
            return;
        }

        $this->fixtures[$fixtureClass] = $fixture;

        if ($fixture instanceof Neo4jDependentFixtureInterface) {
            $this->orderFixturesByDependencies = true;

            foreach ($fixture->getDependencies() as $class) {
                if (class_exists($class)) {
                    $this->addFixture(new $class());
                }
            }
        }
    }
1075310
private function load()
    {
        if ($this->loaded) {
            return $this;
        }

        if (0 == count($this->dirs)) {
            return $this;
        }

        $loaderResolver = new LoaderResolver(array(
            new YamlLoader()
        ));
        $loader = new DelegatingLoader($loaderResolver);

        $finder = new Finder();
        $finder->files()->in($this->dirs)->name('schemas.yml');

        foreach ($finder as $file) {
            $schemas = $loader->load((string)$file);
            foreach ($schemas as $schema) {
                $this->addSchema($schema);
            }
        }

        $this->loaded = true;

        return $this;
    }
251844
protected function nextObject(\Iterator $iterator)
    {
        if ($iterator->valid()) {
            $object = $iterator->current();

            $iterator->next();

            return $object;
        }

        return false;
    }
285219
protected function _getFixturesFromOptions() {
		$fixtureString = $this->param('fixtures');
		if (!empty($fixtureString)) {
			$fixtures = explode(',', $fixtureString);
			foreach ($fixtures as $key => $fixture) {
				$fixtures[$key] = $fixture . 'Fixture';
			}
			return $fixtures;
		}

		return false;
	}
457329
public function getIterator()
    {
        if (is_null($this->_iterator)) {
            $this->_iterator = new Iterator($this->_items);
        }
        return $this->_iterator;
    }
424040
public function register(FixtureLoader $loader)
    {
        $value = new Pair($loader->getName(), $loader);
        $this->loaders->add($value);
        return $this;
    }
959215
public function setBundles($iterate): self
    {
        foreach ($iterate as $name => $bundle)
        {
            $this->pushBundle($name, $bundle);
        }

        return $this;
    }
559425
public function getFixtures()
    {
        if ($this->_fixtures === null) {
            $this->_fixtures = $this->createFixtures($this->fixtures());
        }

        return $this->_fixtures;
    }
221595
public static function catchAll(string $type, \ArrayIterator $iterator): Rdata\RdataInterface
    {
        if (!Rdata\Factory::isTypeImplemented($type)) {
            return new Rdata\PolymorphicRdata($type, implode(Tokens::SPACE, self::getAllRemaining($iterator)));
        }

        return call_user_func_array([Rdata\Factory::class, $type], self::getAllRemaining($iterator));
    }
98463
public static function Remove( $iter, $index )
	{
		return new NodeIterator( function() use( $iter, $index ) { return ExtFuncs::RemoveIterator( $iter->CloneInstance(), $index ); } );
	}
888359
private function parseHeaderRow(Iterator $iterator)
    {
        if ($this->csvFormat->hasHeaderRow()) {
            $iterator = new CallbackFilterIterator($iterator, [$this, 'handleHeaderRow']);
            $iterator = new MapIterator($iterator, [$this, 'mapHeaders']);
        }
        return $iterator;
    }