{"id":15029432,"url":"https://github.com/bauhausphp/config","last_synced_at":"2026-03-15T08:13:30.895Z","repository":{"id":62492184,"uuid":"77490803","full_name":"bauhausphp/config","owner":"bauhausphp","description":"PSR-11 configuration container","archived":false,"fork":false,"pushed_at":"2018-04-03T21:24:50.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T21:49:31.039Z","etag":null,"topics":["config","container","php72","psr-11"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bauhausphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-28T00:33:01.000Z","updated_at":"2018-04-26T22:29:54.000Z","dependencies_parsed_at":"2022-11-02T11:30:41.374Z","dependency_job_id":null,"html_url":"https://github.com/bauhausphp/config","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bauhausphp","download_url":"https://codeload.github.com/bauhausphp/config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243339197,"owners_count":20275648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config","container","php72","psr-11"],"created_at":"2024-09-24T20:10:39.531Z","updated_at":"2025-12-26T08:03:22.536Z","avatar_url":"https://github.com/bauhausphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/travis/bauhausphp/config/master.svg?style=flat-square)](https://travis-ci.org/bauhausphp/config)\n[![Coverage Status](https://img.shields.io/coveralls/bauhausphp/config/master.svg?style=flat-square)](https://coveralls.io/github/bauhausphp/config?branch=master)\n[![Codacy Badge](https://img.shields.io/codacy/534139d09a5941ecbfcb9dd922e30111.svg?style=flat-square)](https://www.codacy.com/app/bauhausphp/config)\n\n[![Latest Stable Version](https://poser.pugx.org/bauhaus/config/v/stable?format=flat-square)](https://packagist.org/packages/bauhaus/config)\n[![Latest Unstable Version](https://poser.pugx.org/bauhaus/config/v/unstable?format=flat-square)](https://packagist.org/packages/bauhaus/config)\n[![Total Downloads](https://poser.pugx.org/bauhaus/config/downloads?format=flat-square)](https://packagist.org/packages/bauhaus/config)\n[![composer.lock](https://poser.pugx.org/bauhaus/config/composerlock?format=flat-square)](https://packagist.org/packages/bauhaus/config)\n\n\u003e **Warning!** This package won't worry about backward compatibily for `v0.*`.\n\n# Bauhaus Config\n\nBauhaus Config aims to provide a simple way to load and validate configurations\nvia a container implementation of [PSR-11](http://www.php-fig.org/psr/psr-11/).\n\n## TODOS\n\nThis package isn't still complete. Missing features are:\n\n* Validate configuration schema (use JSON schema)\n* Load from `yaml` (It will be done in a new repository bauhaus/config-yaml)\n\n## Motivation\n\nIt's annoying when something inside your application breaks just because a\nconfiguration entry was missing.\n\nTo prevent it, Bauhaus Config validates when the configurations are loaded\n(being implemented).\n\n## Usage\n\n```php\n\u003c?php\n\nuse Psr\\Container\\NotFoundExceptionInterface as PsrNotFoundException;\nuse Psr\\Container\\ContainerInterface as PsrContainer;\nuse Bauhaus\\Config;\nuse Bauhaus\\Config\\NotFoundException;\n\n$config = new Config([\n    'instrument' =\u003e 'bass',\n    'pokemons' =\u003e ['charmander', 'pikachu'],\n    'books' =\u003e [\n        'study' =\u003e ['Clean Code', 'GOOS', 'Design Patterns'],\n    ],\n]);\n\n$config instanceof PsrContainer; // true\n\n$config-\u003ehas('instrument'); // true\n$config-\u003ehas('pokemons'); // true\n$config-\u003ehas('books.study'); // true\n$config-\u003ehas('cars'); // false\n$config-\u003ehas('travels.asia'); // false\n\n$config-\u003eget('instrument'); // 'bass'\n$config-\u003eget('pokemons'); // ['charmander', 'pikachu']\n$config-\u003eget('books'); // Config(['study' =\u003e ['Clean Code', 'GOOS', 'Design Patterns']])\n$config-\u003eget('cars'); // throw NotFoundException implementing PsrNotFoundException\n$config-\u003eget('travels.asia'); // throw NotFoundException implementing PsrNotFoundException\n\n$config-\u003eget('books')-\u003ehas('study'); // true\n```\n\n## Installation\n\nInstall it using [Composer](https://getcomposer.org/):\n\n```shell\n$ composer require bauhaus/config\n```\n\n## Coding Standard and Testing\n\nThis code has two levels of testing:\n\n1. Coding standard (using PHPCS with PSR-2 standard):\n   ```shell\n   $ composer run test:cs\n   ```\n\n2. Unit tests (using PHPUnit):\n   ```shell\n   $ composer run test:unit\n   ```\n\nTo run all at one:\n\n```shell\n$ composer run tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbauhausphp%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fconfig/lists"}