Loader

Loads the template and user-defined configuration file from disk and creates a Configuration object from it.

This class will merge the template file and the user-defined configuration file together and serialize it into a configuration object (defaults to phpDocumentor\Configuration).

package

Default

Methods

Registers the dependencies with the loader.

__construct(\JMS\Serializer\Serializer $serializer, \phpDocumentor\Configuration\Merger $merger) 

Arguments

$serializer

\JMS\Serializer\Serializer

Object used to serialize configuration files to objects.

$merger

\phpDocumentor\Configuration\Merger

Object that merges variables, including objects.

Combines the given configuration files and serializes a new Configuration object from them.

createConfigurationObject(string $templatePath, string $defaultUserConfigPath, null|boolean|string $customUserConfigPath, string $class) : null|object

Arguments

$templatePath

string

Path to the template configuration file.

$defaultUserConfigPath

string

Path to the phpdoc.xml or phpdoc,dist.xml in the current working directory.

$customUserConfigPath

null|boolean|string

Path to the user-defined config file given using the command-line.

$class

string

Base Configuration class name to construct and populate.

Response

null|object

Reads the `--config`, or `-c`, command line option and returns a path to the configuration file from those options or false if no existing path was given.

fetchUserConfigFileFromCommandLineOptions() : boolean|string

Response

boolean|string

Verifies if the given path is valid and readable.

isValidFile(boolean|string $path) : boolean

Arguments

$path

boolean|string

Response

boolean

Loads the configuration from the provided paths and returns a populated configuration object.

load(string $templatePath, string $userConfigurationPath, string $class = 'phpDocumentor\Configuration') : object

Arguments

$templatePath

string

Path to configuration file containing default settings.

$userConfigurationPath

string

Path to a file containing user overrides.

$class

string

The class to instantiate and populate with these options.

Response

object

Properties

Object used to serialize configuration files to objects.

serializer : \JMS\Serializer\Serializer
var

Object used to serialize configuration files to objects.

Type(s)

\JMS\Serializer\Serializer

Object that merges variables, including objects.

merger : \phpDocumentor\Configuration\Merger
var

Object that merges variables, including objects.

Type(s)

\phpDocumentor\Configuration\Merger