GuardedWriter
in package
implements
WriterInterface
FinalYes
Table of Contents
Interfaces
Properties
- $allowList : array<string|int, string>
- The variable name allow list.
- $writer : WriterInterface
- The inner writer to use.
Methods
- __construct() : void
- Create a new guarded writer instance.
- delete() : bool
- Delete an environment variable, if possible.
- write() : bool
- Write to an environment variable, if possible.
- isAllowed() : bool
- Determine if the given variable is allowed.
Properties
$allowList
The variable name allow list.
private
array<string|int, string>
$allowList
$writer
The inner writer to use.
private
WriterInterface
$writer
Methods
__construct()
Create a new guarded writer instance.
public
__construct(WriterInterface $writer, array<string|int, string> $allowList) : void
Parameters
- $writer : WriterInterface
- $allowList : array<string|int, string>
delete()
Delete an environment variable, if possible.
public
delete(non-empty-string $name) : bool
Parameters
- $name : non-empty-string
Return values
boolwrite()
Write to an environment variable, if possible.
public
write(non-empty-string $name, string $value) : bool
Parameters
- $name : non-empty-string
- $value : string
Return values
boolisAllowed()
Determine if the given variable is allowed.
private
isAllowed(non-empty-string $name) : bool
Parameters
- $name : non-empty-string