RepositoryBuilder
in package
Table of Contents
Constants
- DEFAULT_ADAPTERS = [\Dotenv\Repository\Adapter\ServerConstAdapter::class, \Dotenv\Repository\Adapter\EnvConstAdapter::class]
- The set of default adapters.
Properties
- $allowList : array<string|int, string>|null
- The variable name allow list.
- $immutable : bool
- Are we immutable?
- $readers : array<string|int, ReaderInterface>
- The set of readers to use.
- $writers : array<string|int, WriterInterface>
- The set of writers to use.
Methods
- addAdapter() : RepositoryBuilder
- Creates a repository builder with the given adapter added.
- addReader() : RepositoryBuilder
- Creates a repository builder with the given reader added.
- addWriter() : RepositoryBuilder
- Creates a repository builder with the given writer added.
- allowList() : RepositoryBuilder
- Creates a repository builder with the given allow list.
- createWithDefaultAdapters() : RepositoryBuilder
- Create a new repository builder instance with the default adapters added.
- createWithNoAdapters() : RepositoryBuilder
- Create a new repository builder instance with no adapters added.
- immutable() : RepositoryBuilder
- Creates a repository builder with mutability enabled.
- make() : RepositoryInterface
- Creates a new repository instance.
- __construct() : void
- Create a new repository builder instance.
- defaultAdapters() : Generator<string|int, AdapterInterface>
- Return the array of default adapters.
- isAnAdapterClass() : bool
- Determine if the given name if of an adapterclass.
Constants
DEFAULT_ADAPTERS
The set of default adapters.
private
mixed
DEFAULT_ADAPTERS
= [\Dotenv\Repository\Adapter\ServerConstAdapter::class, \Dotenv\Repository\Adapter\EnvConstAdapter::class]
Properties
$allowList
The variable name allow list.
private
array<string|int, string>|null
$allowList
$immutable
Are we immutable?
private
bool
$immutable
$readers
The set of readers to use.
private
array<string|int, ReaderInterface>
$readers
$writers
The set of writers to use.
private
array<string|int, WriterInterface>
$writers
Methods
addAdapter()
Creates a repository builder with the given adapter added.
public
addAdapter(WriterInterface|string $adapter) : RepositoryBuilder
Accepts either an adapter instance, or a class-string for an adapter. If the adapter is not supported, then we silently skip adding it. We will add the adapter as both a reader and a writer.
Parameters
- $adapter : WriterInterface|string
Tags
Return values
RepositoryBuilderaddReader()
Creates a repository builder with the given reader added.
public
addReader(ReaderInterface|string $reader) : RepositoryBuilder
Accepts either a reader instance, or a class-string for an adapter. If the adapter is not supported, then we silently skip adding it.
Parameters
- $reader : ReaderInterface|string
Tags
Return values
RepositoryBuilderaddWriter()
Creates a repository builder with the given writer added.
public
addWriter(WriterInterface|string $writer) : RepositoryBuilder
Accepts either a writer instance, or a class-string for an adapter. If the adapter is not supported, then we silently skip adding it.
Parameters
- $writer : WriterInterface|string
Tags
Return values
RepositoryBuilderallowList()
Creates a repository builder with the given allow list.
public
allowList([array<string|int, string>|null $allowList = null ]) : RepositoryBuilder
Parameters
- $allowList : array<string|int, string>|null = null
Return values
RepositoryBuildercreateWithDefaultAdapters()
Create a new repository builder instance with the default adapters added.
public
static createWithDefaultAdapters() : RepositoryBuilder
Return values
RepositoryBuildercreateWithNoAdapters()
Create a new repository builder instance with no adapters added.
public
static createWithNoAdapters() : RepositoryBuilder
Return values
RepositoryBuilderimmutable()
Creates a repository builder with mutability enabled.
public
immutable() : RepositoryBuilder
Return values
RepositoryBuildermake()
Creates a new repository instance.
public
make() : RepositoryInterface
Return values
RepositoryInterface__construct()
Create a new repository builder instance.
private
__construct([array<string|int, ReaderInterface> $readers = [] ][, array<string|int, WriterInterface> $writers = [] ][, bool $immutable = false ][, array<string|int, string>|null $allowList = null ]) : void
Parameters
- $readers : array<string|int, ReaderInterface> = []
- $writers : array<string|int, WriterInterface> = []
- $immutable : bool = false
- $allowList : array<string|int, string>|null = null
defaultAdapters()
Return the array of default adapters.
private
static defaultAdapters() : Generator<string|int, AdapterInterface>
Return values
Generator<string|int, AdapterInterface>isAnAdapterClass()
Determine if the given name if of an adapterclass.
private
static isAnAdapterClass(string $name) : bool
Parameters
- $name : string