PHP Class Puli\Manager\Api\Module\ModuleFile

Since: 1.0
Author: Bernhard Schussek ([email protected])
Afficher le fichier Open project: puli/manager Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string | null $moduleName = null, string | null $path = null ) Creates a new module file.
addBindingDescriptor ( Puli\Manager\Api\Discovery\BindingDescriptor $descriptor ) Adds a binding descriptor.
addDependency ( string $moduleName ) Adds a dependency to a module.
addExtraKeys ( array $values ) Sets multiple extra keys at once.
addPathMapping ( PathMapping $mapping ) Adds a path mapping.
addTypeDescriptor ( Puli\Manager\Api\Discovery\BindingTypeDescriptor $descriptor ) Adds a type descriptor.
clearBindingDescriptors ( ) Removes all binding descriptors.
clearDependencies ( ) Removes all dependencies.
clearExtraKeys ( ) Removes all extra keys.
clearPathMappings ( ) Removes all path mappings.
clearTypeDescriptors ( ) Removes all type descriptors.
getBindingDescriptor ( Rhumsaa\Uuid\Uuid $uuid ) : Puli\Manager\Api\Discovery\BindingDescriptor Returns the binding descriptor with the given UUID.
getBindingDescriptors ( ) : Puli\Manager\Api\Discovery\BindingDescriptor[] Returns the binding descriptors.
getDependencies ( ) : string[] Returns the names of the modules this module overrides.
getExtraKey ( string $key, mixed $default = null ) : mixed Returns the value of an extra key.
getExtraKeys ( ) : array Returns all stored extra keys.
getModuleName ( ) : string | null Returns the module name.
getPath ( ) : string | null Returns the path to the module file.
getPathMapping ( string $repositoryPath ) : PathMapping Returns the path mapping for a repository path.
getPathMappings ( ) : PathMapping[] Returns the path mappings.
getTypeDescriptor ( string $typeName ) : Puli\Manager\Api\Discovery\BindingTypeDescriptor Returns the type descriptor with the given name.
getTypeDescriptors ( ) : Puli\Manager\Api\Discovery\BindingTypeDescriptor[] Returns the type descriptors.
getVersion ( ) : string Returns the version of the module file.
hasBindingDescriptor ( Rhumsaa\Uuid\Uuid $uuid ) : boolean Returns whether the binding descriptor exists in this file.
hasBindingDescriptors ( ) : boolean Returns whether the file contains any binding descriptors.
hasDependencies ( ) : boolean Returns whether the module has dependencies on other modules.
hasDependency ( string $moduleName ) : boolean Returns whether the module depends on a given module.
hasExtraKey ( string $key ) : boolean Returns whether the given extra key exists.
hasExtraKeys ( ) : boolean Returns whether the file contains any extra keys.
hasPathMapping ( string $repositoryPath ) : boolean Returns whether the file contains a path mapping for a repository path.
hasPathMappings ( ) : boolean Returns whether the file contains any path mappings.
hasTypeDescriptor ( string $typeName ) : boolean Returns whether a type is defined in this file.
hasTypeDescriptors ( ) : boolean Returns whether the file contains any type descriptors.
removeBindingDescriptor ( Rhumsaa\Uuid\Uuid $uuid ) Removes a binding descriptor.
removeDependency ( string $moduleName ) Adds a dependency to a module.
removeExtraKey ( string $key ) Removes an extra key.
removePathMapping ( string $repositoryPath ) Removes the path mapping for a repository path.
removeTypeDescriptor ( string $typeName ) Removes a type descriptor.
setDependencies ( array $moduleNames ) Sets the names of the modules this module depends on.
setExtraKey ( string $key, mixed $value ) Sets an extra key in the module file.
setExtraKeys ( array $values ) Sets multiple extra keys at once.
setModuleName ( string | null $moduleName ) Sets the module name.
setVersion ( string $version ) Sets the version of the module file.

Method Details

__construct() public méthode

Creates a new module file.
public __construct ( string | null $moduleName = null, string | null $path = null )
$moduleName string | null The module name. Optional.
$path string | null The path where the file is stored or `null` if this configuration is not stored on the file system.

addBindingDescriptor() public méthode

Adds a binding descriptor.
public addBindingDescriptor ( Puli\Manager\Api\Discovery\BindingDescriptor $descriptor )
$descriptor Puli\Manager\Api\Discovery\BindingDescriptor The binding descriptor to add.

addDependency() public méthode

Adds a dependency to a module.
public addDependency ( string $moduleName )
$moduleName string The name of the module.

addExtraKeys() public méthode

Existing extra keys are preserved.
See also: setExtraKey()
public addExtraKeys ( array $values )
$values array The values indexed by their key names.

addPathMapping() public méthode

Adds a path mapping.
public addPathMapping ( PathMapping $mapping )
$mapping Puli\Manager\Api\Repository\PathMapping The path mapping.

addTypeDescriptor() public méthode

Adds a type descriptor.
public addTypeDescriptor ( Puli\Manager\Api\Discovery\BindingTypeDescriptor $descriptor )
$descriptor Puli\Manager\Api\Discovery\BindingTypeDescriptor The type descriptor.

clearBindingDescriptors() public méthode

Removes all binding descriptors.

clearDependencies() public méthode

Removes all dependencies.
public clearDependencies ( )

clearExtraKeys() public méthode

Removes all extra keys.
See also: setExtraKey()
public clearExtraKeys ( )

clearPathMappings() public méthode

Removes all path mappings.
public clearPathMappings ( )

clearTypeDescriptors() public méthode

Removes all type descriptors.

getBindingDescriptor() public méthode

Returns the binding descriptor with the given UUID.
public getBindingDescriptor ( Rhumsaa\Uuid\Uuid $uuid ) : Puli\Manager\Api\Discovery\BindingDescriptor
$uuid Rhumsaa\Uuid\Uuid The UUID of the binding descriptor.
Résultat Puli\Manager\Api\Discovery\BindingDescriptor The binding descriptor.

getBindingDescriptors() public méthode

Returns the binding descriptors.
public getBindingDescriptors ( ) : Puli\Manager\Api\Discovery\BindingDescriptor[]
Résultat Puli\Manager\Api\Discovery\BindingDescriptor[] The binding descriptors.

getDependencies() public méthode

Returns the names of the modules this module overrides.
public getDependencies ( ) : string[]
Résultat string[] The names of the overridden modules.

getExtraKey() public méthode

Returns the value of an extra key.
See also: setExtraKey()
public getExtraKey ( string $key, mixed $default = null ) : mixed
$key string The name of the key.
$default mixed The value to return if the key was not set.
Résultat mixed The value stored for the key.

getExtraKeys() public méthode

Returns all stored extra keys.
See also: setExtraKey()
public getExtraKeys ( ) : array
Résultat array The stored values indexed by their key names.

getModuleName() public méthode

Returns the module name.
public getModuleName ( ) : string | null
Résultat string | null The module name or `null` if none is set.

getPath() public méthode

Returns the path to the module file.
public getPath ( ) : string | null
Résultat string | null The path or `null` if this file is not stored on the file system.

getPathMapping() public méthode

Returns the path mapping for a repository path.
public getPathMapping ( string $repositoryPath ) : PathMapping
$repositoryPath string The repository path.
Résultat Puli\Manager\Api\Repository\PathMapping The corresponding path mapping.

getPathMappings() public méthode

Returns the path mappings.
public getPathMappings ( ) : PathMapping[]
Résultat Puli\Manager\Api\Repository\PathMapping[] The path mappings.

getTypeDescriptor() public méthode

Returns the type descriptor with the given name.
public getTypeDescriptor ( string $typeName ) : Puli\Manager\Api\Discovery\BindingTypeDescriptor
$typeName string The type name.
Résultat Puli\Manager\Api\Discovery\BindingTypeDescriptor The type descriptor.

getTypeDescriptors() public méthode

Returns the type descriptors.
public getTypeDescriptors ( ) : Puli\Manager\Api\Discovery\BindingTypeDescriptor[]
Résultat Puli\Manager\Api\Discovery\BindingTypeDescriptor[] The type descriptors.

getVersion() public méthode

Returns the version of the module file.
public getVersion ( ) : string
Résultat string The module file version.

hasBindingDescriptor() public méthode

Returns whether the binding descriptor exists in this file.
public hasBindingDescriptor ( Rhumsaa\Uuid\Uuid $uuid ) : boolean
$uuid Rhumsaa\Uuid\Uuid The UUID of the binding descriptor.
Résultat boolean Whether the file contains the binding descriptor.

hasBindingDescriptors() public méthode

Returns whether the file contains any binding descriptors.
public hasBindingDescriptors ( ) : boolean
Résultat boolean Returns `true` if the file contains binding descriptors and `false` otherwise.

hasDependencies() public méthode

Returns whether the module has dependencies on other modules.
public hasDependencies ( ) : boolean
Résultat boolean Returns `true` if the module depends on other modules and `false` otherwise.

hasDependency() public méthode

Returns whether the module depends on a given module.
public hasDependency ( string $moduleName ) : boolean
$moduleName string The name of the module.
Résultat boolean Returns `true` if the module depends on the given module.

hasExtraKey() public méthode

Returns whether the given extra key exists.
See also: setExtraKey()
public hasExtraKey ( string $key ) : boolean
$key string The name of the key.
Résultat boolean Returns `true` if the given extra key exists and `false` otherwise.

hasExtraKeys() public méthode

Returns whether the file contains any extra keys.
See also: setExtraKey()
public hasExtraKeys ( ) : boolean
Résultat boolean Returns `true` if the file contains extra keys and `false` otherwise.

hasPathMapping() public méthode

Returns whether the file contains a path mapping for a repository path.
public hasPathMapping ( string $repositoryPath ) : boolean
$repositoryPath string The repository path.
Résultat boolean Returns `true` if the file contains a mapping for the path.

hasPathMappings() public méthode

Returns whether the file contains any path mappings.
public hasPathMappings ( ) : boolean
Résultat boolean Returns `true` if the file contains path mappings and `false` otherwise.

hasTypeDescriptor() public méthode

Returns whether a type is defined in this file.
public hasTypeDescriptor ( string $typeName ) : boolean
$typeName string The type name.
Résultat boolean Whether the type is defined in the file.

hasTypeDescriptors() public méthode

Returns whether the file contains any type descriptors.
public hasTypeDescriptors ( ) : boolean
Résultat boolean Returns `true` if the file contains type descriptors and `false` otherwise.

removeBindingDescriptor() public méthode

Removes a binding descriptor.
public removeBindingDescriptor ( Rhumsaa\Uuid\Uuid $uuid )
$uuid Rhumsaa\Uuid\Uuid The UUID of the binding descriptor to remove.

removeDependency() public méthode

Adds a dependency to a module.
public removeDependency ( string $moduleName )
$moduleName string The name of the module.

removeExtraKey() public méthode

Removes an extra key.
See also: setExtraKey()
public removeExtraKey ( string $key )
$key string The name of the key.

removePathMapping() public méthode

Removes the path mapping for a repository path.
public removePathMapping ( string $repositoryPath )
$repositoryPath string The repository path.

removeTypeDescriptor() public méthode

Removes a type descriptor.
public removeTypeDescriptor ( string $typeName )
$typeName string The type name.

setDependencies() public méthode

Sets the names of the modules this module depends on.
public setDependencies ( array $moduleNames )
$moduleNames array The names of the modules.

setExtraKey() public méthode

Extra keys can be freely set by the user. They are stored in a separate area of the module file and not validated in any way.
public setExtraKey ( string $key, mixed $value )
$key string The name of the key.
$value mixed The value to store.

setExtraKeys() public méthode

Existing extra keys are overridden.
See also: setExtraKey()
public setExtraKeys ( array $values )
$values array The values indexed by their key names.

setModuleName() public méthode

Sets the module name.
public setModuleName ( string | null $moduleName )
$moduleName string | null The module name or `null` to unset.

setVersion() public méthode

Sets the version of the module file.
public setVersion ( string $version )
$version string The module file version.