Scalr\Tests\Functional\Api\V2\ApiTest::mapPath PHP Метод

mapPath() защищенный Метод

Generate url with api endpoint and saved data
protected mapPath ( string $path, string $type ) : Generator
$path string api endpoint
$type string api specifications type
Результат Generator
    protected function mapPath($path, $type)
    {
        $iterator = new \RecursiveIteratorIterator(new ApiDataRecursiveFilterIterator(new \RecursiveArrayIterator(self::$data), explode('/', trim($path, '/')), $type));
        foreach ($iterator as $part => $value) {
            // Build path based on parent keys
            for ($i = $iterator->getDepth() - 1; $i >= 0; $i--) {
                $part = $iterator->getSubIterator($i)->key() . '/' . $part;
            }
            (yield $part);
        }
    }