Get the middleware for the path.

@param \Collective\Annotations\Routing\Annotations\AbstractPath $path

@return array
487559
protected function getMiddleware(AbstractPath $path)
    {
        $classMiddleware = $this->getClassMiddlewareForPath($path)->all();

        return $this->implodeArray(
            array_merge($classMiddleware, $path->middleware, $this->middleware)
        );
    }
533591
public function getPublicPackageResourceUriByPath($path)
    {
        $this->initialize();
        list($packageKey, $relativePathAndFilename) = $this->getPackageAndPathByPublicPath($path);
        return $this->getPublicPackageResourceUri($packageKey, $relativePathAndFilename);
    }
249204
protected static function mapPath(string $path) : string
    {
        if (getenv('APP_MAPPING')) {
            $path = str_replace(AbstractApp::getAppRoot(), getenv('APP_MAPPING'), $path);
        }

        return $path;
    }
368694
private function withPath($path)
    {
        $params = $this->getOptions(true);

        return $this->getBucketKey($path) + $params;
    }
63973
public function getEngineFromPath($path)
    {
        $extension = $this->getExtension($path);

        $engine = $this->extensions[$extension];

        return $this->engines->resolve($engine);
    }
75989
public function getUrlForRelativePath($path)
    {
        return $this->getUrlForPath(
            $this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
    }
714357
protected function _getProcessorByPath($path)
    {
        if (!$path) {
            return;
        }

        if (!is_array(static::$processorcachepath)) {
            static::$processorcachepath = array();
        }

        if (array_key_exists($path, static::$processorcachepath)) {
            return static::$processorcachepath[$path];
        }

        foreach ($this->processors as &$processor) {

            /* @var $processor AbstractFileProcessor */
            $match = $processor->_getConfig('fieldmatch');

            if (preg_match($match, $path)) {
                static::$processorcachepath[$path] = $processor;

                return $processor;
            }
        }
    }
1113812
private function getPath($path)
    {
        $uri = parse_url($path);

        $stream = $this->getStreamByPathScheme($path);
        if ($stream instanceof StreamInterface) {
            foreach ($stream->getPaths() as $streamDomain => $streamPath) {
                if ($streamDomain === $uri['host']) {
                    $realPath = $this->getRealPath($uri, $streamPath);
                    if (strpos($realPath, $streamPath) === 0) {
                        return $realPath;
                    }
                }
            }
        }
    }
37530
public function getImportPaths($path = null)
    {
        if ($path === null) {
            return $this->importPaths;
        }

        return isset($this->importPaths[$path])
            ? $this->importPaths[$path]
            : [];
    }
359631
public function locate($path)
    {
        $repository = $this->getRepository();

        if(!$repository->contains($path)){
            throw new \InvalidArgumentException(sprintf('Their is no path %s in repository.', $path));
        }

        $resource = $repository->get($path);

        if(!($resource instanceof FilesystemResource)){
            throw new \RuntimeException(['Expect %s! %s given', FilesystemResource::class, get_class($resource)]);
        }

        return $resource;
    }
1121083
public function getResource($path)
    {
        $path = Path::normalise($path, true);
        if (empty($path)) {
            throw new InvalidArgumentException('$path is required');
        }
        if (isset($this->resources[$path])) {
            return $this->resources[$path];
        }
        return $this->resources[$path] = new ModuleResource($this, $path);
    }
57063
protected function _getProcessor($path)
    {
        if (!$path) {
            return;
        }

        if (!is_array(static::$processorcache)) {
            static::$processorcache = array();
        }

        if (array_key_exists($path, static::$processorcache)) {
            return static::$processorcache[$path];
        }

        foreach ($this->processors as &$processor) {

            /* @var $processor AbstractFileProcessor */
            $config = $processor->getConfig();

            if (preg_match($config['file'], $path)) {
                static::$processorcache[$path] = $processor;

                return $processor;
            }
        }
    }
1178850
protected function getFiles($path)
    {
        $path = Str::finish($path, '/');

        if (file_exists($path . App::getLocale())) {
            return File::files($path . App::getLocale());
        } elseif (file_exists($path . config('app.fallback_locale'))) {
            return File::files($path . config('app.fallback_locale'));
        }

        return [];
    }
948704
protected function _getAuth($path = null) {
		if ($this->getConfig('autoClearCache') && Configure::read('debug')) {
			Cache::delete($this->getConfig('allowCacheKey'), $this->getConfig('cache'));
		}
		$roles = Cache::read($this->getConfig('allowCacheKey'), $this->getConfig('cache'));
		if ($roles !== false) {
			return $roles;
		}

		if ($path === null) {
			$path = $this->getConfig('allowFilePath');
		}
		$iniArray = $this->_parseFiles($path, $this->getConfig('allowFile'));

		$res = [];
		foreach ($iniArray as $key => $actions) {
			$res[$key] = $this->_deconstructIniKey($key);
			$res[$key]['map'] = $actions;

			$actions = explode(',', $actions);

			if (in_array('*', $actions)) {
				$res[$key]['actions'] = [];
				continue;
			}

			foreach ($actions as $action) {
				$action = trim($action);
				if (!$action) {
					continue;
				}

				$res[$key]['actions'][] = $action;
			}
		}

		Cache::write($this->getConfig('allowCacheKey'), $res, $this->getConfig('cache'));
		return $res;
	}
1044418
public function route($path)
    {
        $route = $this->configureSlice()->atData($path);

        if (empty($route))
        {
            throw new Exceptions\NotFound('Route `' . $path . '` not found');
        }

        return $route;
    }
943411
public function get($path)
    {
        if (! $this->has($path) && ! $this->has('*')) {
            throw new \Exception('There is no collection that collects for the path ['.$path.']');
        }

        if (! $this->has($path) && $this->has('*')) {
            return $this->items[$this->pathLookupTable['*']];
        }

        return $this->items[$this->pathLookupTable[$path]];
    }
1230841
protected function wrapMiddleware($path, $middleware)
    {
        return function(
            ServerRequestInterface $request,
            ResponseInterface $response,
            $next
        ) use ($middleware, $path) {
            $uriPath = $request->getUri()->getPath();

            if ($uriPath === $path || strpos($uriPath, rtrim($path, '/') . '/') === 0) {
                $ret = $middleware($request, $response, $next);
            } else {
                $ret = $next($request, $response);
            }
            
            return $ret;
        };
    }