Menu

## LibraryConfiguration
in package

LibraryConfiguration.php : 14

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

#### $composerManager

LibraryConfiguration.php : 29
`private ComposerManager $composerManager`

#### $daenerysCommands

LibraryConfiguration.php : 20
`private array<string|int, mixed> $daenerysCommands`

#### $entityDirectory

LibraryConfiguration.php : 17
`private string|null $entityDirectory`

#### $package

LibraryConfiguration.php : 30
`private PackageInterface $package`

#### $rawConfig

LibraryConfiguration.php : 19
`private array<string|int, mixed> $rawConfig`

#### $rootNamespace

LibraryConfiguration.php : 16
`private string $rootNamespace`

#### $subscriptionPatterns

LibraryConfiguration.php : 18
`private array<string|int, mixed> $subscriptionPatterns`

### Methods

#### __construct()

LibraryConfiguration.php : 28

Construct a configuration.

`public __construct(ComposerManager $composerManager, PackageInterface $package, string $cwd) : mixed`

##### Parameters

$composerManager : ComposerManager
$package : PackageInterface
$cwd : string

##### Return values

mixed —

#### getComposerPackage()

LibraryConfiguration.php : 67

Return the underlying Composer package.

`public getComposerPackage() : PackageInterface`

##### Return values

PackageInterface —

#### getDaenerysCommands()

LibraryConfiguration.php : 228

Returns a list of daenerys commands.

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

##### Return values

array<string|int, mixed> —

#### getEntityDirectory()

LibraryConfiguration.php : 198

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

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

##### Return values

array<string|int, string> —

#### getName()

LibraryConfiguration.php : 76

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

`public getName() : string`

##### Return values

string —

#### getRootNamespace()

LibraryConfiguration.php : 111

Returns the root namespace.

`public getRootNamespace() : string`

##### Return values

string —

#### getSubKeyIfItExists()

LibraryConfiguration.php : 121

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()

LibraryConfiguration.php : 249

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

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

##### Return values

array<string|int, mixed> —

#### hasDaenerysCommands()

LibraryConfiguration.php : 220

Returns true if this configuration has daenerys commands.

`public hasDaenerysCommands() : bool`

##### Return values

bool —

#### hasEntityDirectory()

LibraryConfiguration.php : 189

Returns true if there are any models to add.

`public hasEntityDirectory() : bool`

##### Return values

bool —

#### iterateKey()

LibraryConfiguration.php : 140

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()

LibraryConfiguration.php : 206

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

`protected findDaenerysCommands() : mixed`

##### Return values

mixed —

#### findEntityDirectory()

LibraryConfiguration.php : 166

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

`protected findEntityDirectory() : mixed`

##### Return values

mixed —

#### findRootNamespace()

LibraryConfiguration.php : 92

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()

LibraryConfiguration.php : 236

Extract from $rawConfig any event subscriptions.

`protected findSubscriptionPatterns() : mixed`

##### Return values

mixed —

#### getConfig()

LibraryConfiguration.php : 156

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

`protected getConfig(mixed ...$arguments) : mixed`

##### Parameters

$arguments : mixed

##### Return values

mixed —

## Search results