Skip to content

Implement EnvironmentInterface #496

@agdobrynin

Description

@agdobrynin

Подумать над тем чтобы учитывать как параметр в конфигураторе env

// config/services_app.php
return static function(DefinitionsConfigurator $configurator, string $env) {}

Можно ввести сущность Environment (EnvironmentInterface) которую прокидывать в DiContainerConfig. Далее дать доступ к ней в DefinitionsConfigurator, либо прокинуть в

// config/services_app.php
return static function(DefinitionsConfigurator $configurator, DiContainerConfig $config) {}
interface EnvironmentInterface
{
    /**
     * Set environment value.
     */
    public function set(string $name, mixed $value): self;

    /**
     * Get environment value.
     */
    public function get(string $name, mixed $default = null): mixed;

    /**
     * Get all environment values.
     */
    public function getAll(): array;
}

Originally posted by @vgrish in #401

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions