Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 719 Bytes

File metadata and controls

34 lines (24 loc) · 719 Bytes

marko/config

Type-safe configuration management with dot notation, automatic merging, and multi-tenant scope support.

Installation

composer require marko/config

Quick Example

use Marko\Config\ConfigRepositoryInterface;

class DatabaseConnection
{
    public function __construct(
        private ConfigRepositoryInterface $config,
    ) {}

    public function connect(): PDO
    {
        $host = $this->config->getString('database.host');
        $port = $this->config->getInt('database.port');

        return new PDO("mysql:host={$host};port={$port}");
    }
}

Documentation

Full usage, API reference, and examples: marko/config