@param string $name
@param string $currentPath
@param bool   $first

@return array
486136
public function locate($name, $currentPath = null, $first = true)
    {
        $paths = [];
        $path = $this->kernel->getRootDir().'/Resources/'.$currentPath;
        if (file_exists($path)) {
            $paths[] = $path;
        }
        foreach ($this->kernel->getBundles() as $bundle) {
            $path = $bundle->getPath().'/Resources/'.$currentPath;
            if (file_exists($path)) {
                $paths[] = $path;
            }
        }

        if (!count($paths)) {
            return array();
        }

        $finder = new Finder();
        $files = [];
        foreach ($finder->in($paths)->files()->name($name) as $file) {
            /* @var $file SplFileInfo */
            if ($first) {
                return $file->getPathname();
            }
            $files[] = $file->getPathname();
        }

        return $files;
    }
376051
public function getFirst($name)
    {
        $names = func_get_args();

        foreach ($names as $name) {
            if (isset($this->data[$name])) {
                return $this->data[$name];
            }
        }
    }
381839
protected function getMigrationFile($name, $path = false)
    {
        $path = $path ? $path : $this->migrationPath;
        return $path . DIRECTORY_SEPARATOR . $name . '.php';
    }
582169
private function mergeConfigurationOption(&$currentNode, $name, $value)
    {
        if (empty($currentNode) || empty($name)) {
            return;
        }

        //We're going to be building our own objects here
        if (is_object($value)) {
            $value = (array)$value;
        }

        if (is_array($value)) {
            if ($this->isAssociative($value)) {
                //An associative array can contain non-leaves, recursively merge them in

                $childNode = null;

                if (!empty($currentNode->$name)) {
                    $childNode = $currentNode->$name;
                } else {
                    $childNode = new Parameter($currentNode, $name);
                    $currentNode->$name = $childNode;
                }

                foreach ($value as $subName => $subValue) {
                    $this->mergeConfigurationOption($childNode, $subName, $subValue);
                }
            } else {
                //Simply an array of values, just add them to the node and assume they're leaves

                if (empty($currentNode->$name)) {
                    $currentNode->$name = array();
                }

                if (!is_array($currentNode->$name)) {
                    $currentNode->$name = array();
                }

                foreach ($value as $subValue) {
                    $currentNode->{$name}[] = $subValue;
                }
            }
        } else {
            //Yay, a scalar value
            $currentNode->$name = $value;
        }
    }
583073
protected function attr($path, $name, $val=false) {
		if (!isset($this->defaults[$name])) {
			return false;
		}
		
		
		$perm = null;
		
		if ($this->access) {
			if (is_array($this->access)) {
				$obj    = $this->access[0];
				$method = $this->access[1];
				$perm   = $obj->{$method}($name, $path, $this->options['accessControlData'], $this);
			} else {
				$func = $this->access;
				$perm = $func($name, $path, $this->options['accessControlData'], $this);
			}
			
			if ($perm !== null) {
				return !!$perm;
			}
		}
		
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
			$attrs = $this->attributes[$i];
			$p = $this->separator.$this->_relpath($path);
			if (isset($attrs[$name]) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $p)) {
				$perm = $attrs[$name];
			} 
		}
		
		return $perm === null ? $this->defaults[$name] : !!$perm;
	}
1032412
public function getPath( $reverseSort = false, $mainTranslation = false )
    {
        $pathArray = explode( '/', trim( $this->attribute( 'path_string' ), '/' ) );

        if ( !is_array( $pathArray ) || empty( $pathArray ) || count( $pathArray ) == 1 )
            return array();

        $pathArray = array_slice( $pathArray, 0, count( $pathArray ) - 1 );

        return self::fetchList( array( 'id' => array( $pathArray ) ),
                                null,
                                array( 'path_string' => $reverseSort != false ? 'desc' : 'asc' ),
                                $mainTranslation );
    }
857785
protected function getList($name)
    {
        if (null === ($list = $this->cache->get($name)) || !\is_array($list)) {
            return [];
        }

        return $list;
    }
370104
public function get(array $path)
    {
        $current = &$this->hierarchy;
        foreach ($path as $childId) {
            if (!isset($current[$childId])) {
                return [];
            }
            $current = &$current[$childId];
        }

        return $current;
    }
512389
private function getPathListCurrentAcl(): string
    {
        return sprintf(self::PATH_LIST_CURRENT_ACL, $this->appDir, explode('\\', get_class($this))[3]);
    }
591725
final protected function getOptionalStringArray(array $values, string $name, bool $isFirst = false) : array
    {
        if (isset($values[$name])) {
            $value = $values[$name];
        } elseif ($isFirst && isset($values['value'])) {
            $value = $values['value'];
        } else {
            return [];
        }

        if (is_string($value)) {
            return [$value];
        }

        if (is_array($value)) {
            foreach ($value as $item) {
                if (! is_string($item)) {
                    throw new \LogicException(sprintf(
                        'Attribute "%s" of annotation %s expects an array of strings, %s found in array.',
                        $name,
                        $this->getAnnotationName(),
                        gettype($item)
                    ));
                }
            }

            return $value;
        }

        throw new \LogicException(sprintf(
            'Attribute "%s" of annotation %s expects a string or array of strings, %s given.',
            $name,
            $this->getAnnotationName(),
            gettype($value)
        ));
    }
372804
public function locateResource($name, $dir = null, $first = true)
    {
        if ('@' !== $name[0]) {
            throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
        }

        if (false !== strpos($name, '..')) {
            throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
        }

        $bundleName = substr($name, 1);
        $path = '';
        if (false !== strpos($bundleName, '/')) {
            list($bundleName, $path) = explode('/', $bundleName, 2);
        }

        $isResource = 0 === strpos($path, 'Resources') && null !== $dir;
        $overridePath = substr($path, 9);
        $bundle = $this->getBundle($bundleName);
        $files = [];

        if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
            $files[] = $file;
        }

        if (file_exists($file = $bundle->getPath().'/'.$path)) {
            if ($first && !$isResource) {
                return $file;
            }
            $files[] = $file;
        }

        if (\count($files) > 0) {
            return $first && $isResource ? $files[0] : $files;
        }

        throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name));
    }
420769
private function getExtList($name, PaginationInterface $pagination, array $extList = [])
    {
        $ext = $this->extensionRegistry->getExtension($name);
        $deps = $ext->getDependency();
        foreach ($deps as $dep) {
            $extList = $this->getExtList($dep, $pagination, $extList);
        }
        if ($ext->supportPagination($pagination)) {
            $extList[$name] = $ext;
        }

        return $extList;
    }
106437
public function popFirst(&$first) : NodePath
    {
        $path = $this->path;
        $first = array_shift($path);
        return new NodePath($path);
    }
629785
protected function locateAppResource($name, $dir = null, $first = true)
    {
        if (false !== strpos($name, '..')) {
            throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
        }

        $files = array();
        $parameters = array(
            '%app_path%' => $this->path,
            '%current_theme%' => $this->lastTheme,
            '%current_device%' => $this->activeTheme->getDeviceType(),
            '%template%' => substr($name, strlen('views/')),
        );

        foreach ($this->getPathsForAppResource($parameters) as $checkPaths) {
            if (file_exists($checkPaths)) {
                if ($first) {
                    return $checkPaths;
                }
                $files[] = $checkPaths;
            }
        }

        return $files;
    }
469113
public function read($name, $path = null) {
        // in cache?
        if(isset($this->cache[$name]))
            return !is_null($path) && isset($this->cache[$name][$path]) ? $this->cache[$name][$path] : $this->cache[$name];

        // no cookie?
        if(!$this->check($name))
            return null;

        return $this->cookies->get($name)->read($path);
    }
49401
public function getList( $path = "", $recursive = FALSE )
	{
		$this->connection->checkConnection();
		$parsed	= array();
		if( !$path )
			$path	= $this->getPath();
		$list	= ftp_rawlist( $this->connection->getResource(), $path );
		if( is_array( $list ) )
		{
			foreach( $list as $current )
			{
				$data	= $this->parseListEntry( $current );
				if( count( $data ) )
				{
					$parsed[]	= $data;
					if( $recursive && $data['isdir'] && $data['name'] != "." && $data['name'] != ".." )
					{
						$nested	= $this->getList( $path."/".$data['name'], TRUE );
						foreach( $nested as $entry )
						{
							$entry['name']	= $data['name']."/".$entry['name'];
							$parsed[]	= $entry;
						}
					}
				}
			}
		}
		return $parsed;
	}
1073427
public function isCurrentMigration($name)
    {
        $current = $this->getCurrentMigration();

        return (!is_null($current) && $current->name == $name);
    }