phpDocumentor

PathNormalizingMiddleware
in package
implements MiddlewareInterface

Interfaces, Classes and Traits

MiddlewareInterface

Table of Contents

__invoke()  : array<string|int, mixed>
normalizeCachePath()  : Path
makeDsnRelativeToConfig()  : array<string|int, mixed>
Transforms relative dsn to relative path of working dir.
normalizePath()  : string
normalizePaths()  : array<string|int, mixed>
pathToGlobPattern()  : string

Methods

__invoke()

public __invoke(array<string|int, mixed> $configuration[, UriInterface|null $uri = null ]) : array<string|int, mixed>
Parameters
$configuration : array<string|int, mixed>
$uri : UriInterface|null = null
Return values
array<string|int, mixed>

makeDsnRelativeToConfig()

Transforms relative dsn to relative path of working dir.

private makeDsnRelativeToConfig(array<string|int, mixed> $configuration, UriInterface|null $uri) : array<string|int, mixed>

The dsn defined in the config might be relative. If it is relative it is relative to the location of the config file. The config file could be outside the working directory. But we want to read from the current working dir.

Eg. the config is read from './config/phpdoc.xml' The defined source is '../src'

In this case the src dir on the same level as the config dir is read.

Absolute DSNs are untouched.

Parameters
$configuration : array<string|int, mixed>
$uri : UriInterface|null
Return values
array<string|int, mixed>

normalizePath()

private normalizePath(string $path) : string
Parameters
$path : string
Return values
string

normalizePaths()

private normalizePaths(array<string|int, mixed> $configuration) : array<string|int, mixed>
Parameters
$configuration : array<string|int, mixed>
Return values
array<string|int, mixed>

pathToGlobPattern()

private pathToGlobPattern(string $path) : string
Parameters
$path : string
Return values
string

Search results