Documentation

LibraryConfiguration
in package

Represents the configuration of a LotGD library (like the core, crate or module), with its configuration parameters.

Tags
author

sauterb

Table of Contents

$composerManager  : ComposerManager
$daenerysCommands  : array<string|int, mixed>
$entityDirectory  : string|null
$package  : PackageInterface
$rawConfig  : array<string|int, mixed>
$rootNamespace  : string
$subscriptionPatterns  : array<string|int, mixed>
__construct()  : mixed
Construct a configuration.
getComposerPackage()  : PackageInterface
Return the underlying Composer package.
getDaenerysCommands()  : array<string|int, mixed>
Returns a list of daenerys commands.
getEntityDirectory()  : array<string|int, string>
Returns a list of fqcn for all models added by packages.
getName()  : string
Return the name, in vendor/library format, of this library.
getRootNamespace()  : string
Returns the root namespace.
getSubKeyIfItExists()  : mixed
Returns a subkey if it exists or null.
getSubscriptionPatterns()  : array<string|int, mixed>
Returns a list of event subscription patterns and only the patterns.
hasDaenerysCommands()  : bool
Returns true if this configuration has daenerys commands.
hasEntityDirectory()  : bool
Returns true if there are any models to add.
iterateKey()  : mixed
Tries to iterate an array element given by the arguments.
findDaenerysCommands()  : mixed
Searches the config file for daenerys commands and, if found, adds the class name to a list.
findEntityDirectory()  : mixed
Derives the path where any entity classes might reside from the entityNamespace entry in the config file.
findRootNamespace()  : string
Searches for a root namespace.
findSubscriptionPatterns()  : mixed
Extract from $rawConfig any event subscriptions.
getConfig()  : mixed
Returns a subkey of an array if it exists or null.

Properties

Methods

__construct()

Construct a configuration.

public __construct(ComposerManager $composerManager, PackageInterface $package, string $cwd) : mixed
Parameters
$composerManager : ComposerManager
$package : PackageInterface
$cwd : string
Return values
mixed

getComposerPackage()

Return the underlying Composer package.

public getComposerPackage() : PackageInterface
Return values
PackageInterface

getDaenerysCommands()

Returns a list of daenerys commands.

public getDaenerysCommands() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEntityDirectory()

Returns a list of fqcn for all models added by packages.

public getEntityDirectory() : array<string|int, string>
Return values
array<string|int, string>

getName()

Return the name, in vendor/library format, of this library.

public getName() : string
Return values
string

getRootNamespace()

Returns the root namespace.

public getRootNamespace() : string
Return values
string

getSubKeyIfItExists()

Returns a subkey if it exists or null.

public getSubKeyIfItExists(array<string|int, mixed> $arguments) : mixed
Parameters
$arguments : array<string|int, mixed>
Return values
mixed

getSubscriptionPatterns()

Returns a list of event subscription patterns and only the patterns.

public getSubscriptionPatterns() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasDaenerysCommands()

Returns true if this configuration has daenerys commands.

public hasDaenerysCommands() : bool
Return values
bool

hasEntityDirectory()

Returns true if there are any models to add.

public hasEntityDirectory() : bool
Return values
bool

iterateKey()

Tries to iterate an array element given by the arguments.

public iterateKey(bool|int|float|string|array<string|int, bool>|array<string|int, int>|array<string|int, float>|array<string|int, string> ...$arguments) : mixed
Parameters
$arguments : bool|int|float|string|array<string|int, bool>|array<string|int, int>|array<string|int, float>|array<string|int, string>

array keys, by increasing depth

Return values
mixed

findDaenerysCommands()

Searches the config file for daenerys commands and, if found, adds the class name to a list.

protected findDaenerysCommands() : mixed
Return values
mixed

findEntityDirectory()

Derives the path where any entity classes might reside from the entityNamespace entry in the config file.

protected findEntityDirectory() : mixed
Return values
mixed

findRootNamespace()

Searches for a root namespace.

protected findRootNamespace(PackageInterface $package) : string

This function searches the package's configuration to find it's root namespace. For this, it uses the following order:

  • check psr-4 autoload configuration. If used, it takes the first element
  • check psr-0 autoload configuration. If used, it takes the first element
Parameters
$package : PackageInterface
Tags
throws
Exception

if no namespace has been found

Return values
string

findSubscriptionPatterns()

Extract from $rawConfig any event subscriptions.

protected findSubscriptionPatterns() : mixed
Return values
mixed

getConfig()

Returns a subkey of an array if it exists or null.

protected getConfig(mixed ...$arguments) : mixed
Parameters
$arguments : mixed
Return values
mixed

Search results