PHP Класс Puli\Manager\Api\Module\ModuleFile

С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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() публичный Метод

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

addDependency() публичный Метод

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

addExtraKeys() публичный Метод

Existing extra keys are preserved.
См. также: setExtraKey()
public addExtraKeys ( array $values )
$values array The values indexed by their key names.

addPathMapping() публичный Метод

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

addTypeDescriptor() публичный Метод

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

clearBindingDescriptors() публичный Метод

Removes all binding descriptors.

clearDependencies() публичный Метод

Removes all dependencies.
public clearDependencies ( )

clearExtraKeys() публичный Метод

Removes all extra keys.
См. также: setExtraKey()
public clearExtraKeys ( )

clearPathMappings() публичный Метод

Removes all path mappings.
public clearPathMappings ( )

clearTypeDescriptors() публичный Метод

Removes all type descriptors.

getBindingDescriptor() публичный Метод

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.
Результат Puli\Manager\Api\Discovery\BindingDescriptor The binding descriptor.

getBindingDescriptors() публичный Метод

Returns the binding descriptors.
public getBindingDescriptors ( ) : Puli\Manager\Api\Discovery\BindingDescriptor[]
Результат Puli\Manager\Api\Discovery\BindingDescriptor[] The binding descriptors.

getDependencies() публичный Метод

Returns the names of the modules this module overrides.
public getDependencies ( ) : string[]
Результат string[] The names of the overridden modules.

getExtraKey() публичный Метод

Returns the value of an extra key.
См. также: 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.
Результат mixed The value stored for the key.

getExtraKeys() публичный Метод

Returns all stored extra keys.
См. также: setExtraKey()
public getExtraKeys ( ) : array
Результат array The stored values indexed by their key names.

getModuleName() публичный Метод

Returns the module name.
public getModuleName ( ) : string | null
Результат string | null The module name or `null` if none is set.

getPath() публичный Метод

Returns the path to the module file.
public getPath ( ) : string | null
Результат string | null The path or `null` if this file is not stored on the file system.

getPathMapping() публичный Метод

Returns the path mapping for a repository path.
public getPathMapping ( string $repositoryPath ) : PathMapping
$repositoryPath string The repository path.
Результат Puli\Manager\Api\Repository\PathMapping The corresponding path mapping.

getPathMappings() публичный Метод

Returns the path mappings.
public getPathMappings ( ) : PathMapping[]
Результат Puli\Manager\Api\Repository\PathMapping[] The path mappings.

getTypeDescriptor() публичный Метод

Returns the type descriptor with the given name.
public getTypeDescriptor ( string $typeName ) : Puli\Manager\Api\Discovery\BindingTypeDescriptor
$typeName string The type name.
Результат Puli\Manager\Api\Discovery\BindingTypeDescriptor The type descriptor.

getTypeDescriptors() публичный Метод

Returns the type descriptors.
public getTypeDescriptors ( ) : Puli\Manager\Api\Discovery\BindingTypeDescriptor[]
Результат Puli\Manager\Api\Discovery\BindingTypeDescriptor[] The type descriptors.

getVersion() публичный Метод

Returns the version of the module file.
public getVersion ( ) : string
Результат string The module file version.

hasBindingDescriptor() публичный Метод

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.
Результат boolean Whether the file contains the binding descriptor.

hasBindingDescriptors() публичный Метод

Returns whether the file contains any binding descriptors.
public hasBindingDescriptors ( ) : boolean
Результат boolean Returns `true` if the file contains binding descriptors and `false` otherwise.

hasDependencies() публичный Метод

Returns whether the module has dependencies on other modules.
public hasDependencies ( ) : boolean
Результат boolean Returns `true` if the module depends on other modules and `false` otherwise.

hasDependency() публичный Метод

Returns whether the module depends on a given module.
public hasDependency ( string $moduleName ) : boolean
$moduleName string The name of the module.
Результат boolean Returns `true` if the module depends on the given module.

hasExtraKey() публичный Метод

Returns whether the given extra key exists.
См. также: setExtraKey()
public hasExtraKey ( string $key ) : boolean
$key string The name of the key.
Результат boolean Returns `true` if the given extra key exists and `false` otherwise.

hasExtraKeys() публичный Метод

Returns whether the file contains any extra keys.
См. также: setExtraKey()
public hasExtraKeys ( ) : boolean
Результат boolean Returns `true` if the file contains extra keys and `false` otherwise.

hasPathMapping() публичный Метод

Returns whether the file contains a path mapping for a repository path.
public hasPathMapping ( string $repositoryPath ) : boolean
$repositoryPath string The repository path.
Результат boolean Returns `true` if the file contains a mapping for the path.

hasPathMappings() публичный Метод

Returns whether the file contains any path mappings.
public hasPathMappings ( ) : boolean
Результат boolean Returns `true` if the file contains path mappings and `false` otherwise.

hasTypeDescriptor() публичный Метод

Returns whether a type is defined in this file.
public hasTypeDescriptor ( string $typeName ) : boolean
$typeName string The type name.
Результат boolean Whether the type is defined in the file.

hasTypeDescriptors() публичный Метод

Returns whether the file contains any type descriptors.
public hasTypeDescriptors ( ) : boolean
Результат boolean Returns `true` if the file contains type descriptors and `false` otherwise.

removeBindingDescriptor() публичный Метод

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

removeDependency() публичный Метод

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

removeExtraKey() публичный Метод

Removes an extra key.
См. также: setExtraKey()
public removeExtraKey ( string $key )
$key string The name of the key.

removePathMapping() публичный Метод

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

removeTypeDescriptor() публичный Метод

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

setDependencies() публичный Метод

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

setExtraKey() публичный Метод

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() публичный Метод

Existing extra keys are overridden.
См. также: setExtraKey()
public setExtraKeys ( array $values )
$values array The values indexed by their key names.

setModuleName() публичный Метод

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

setVersion() публичный Метод

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