{"id":27091295,"url":"https://github.com/technically-php/dependency-resolver","last_synced_at":"2025-04-06T07:26:27.844Z","repository":{"id":57066120,"uuid":"344122456","full_name":"technically-php/dependency-resolver","owner":"technically-php","description":"🔁 Dependency-resolver utility based on PSR-11 container to be used for auto-wiring. :elephant: PHP8-ready :tada:","archived":false,"fork":false,"pushed_at":"2023-06-27T21:39:39.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-22T21:08:18.096Z","etag":null,"topics":["dependency","dependency-resolver","injection","php8","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/technically-php.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-03-03T12:42:18.000Z","updated_at":"2023-08-23T03:07:32.000Z","dependencies_parsed_at":"2022-08-24T14:53:59.619Z","dependency_job_id":null,"html_url":"https://github.com/technically-php/dependency-resolver","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Fdependency-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Fdependency-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Fdependency-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technically-php%2Fdependency-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technically-php","download_url":"https://codeload.github.com/technically-php/dependency-resolver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247447387,"owners_count":20940313,"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":["dependency","dependency-resolver","injection","php8","psr-11"],"created_at":"2025-04-06T07:26:27.277Z","updated_at":"2025-04-06T07:26:27.824Z","avatar_url":"https://github.com/technically-php.png","language":"PHP","readme":"# Technically Dependency Resolver\n\n`Technically\\DependencyResolver` is a simple yet powerful tool to instantiate classes\nautowiring their dependencies by resolving them from a [PSR-11][1] container \nor recursively instantiating them with *DependencyResolver* itself.\n\n![Status][badge]\n\n\n## Features\n\n- Based on PSR-11\n- PHP 8.0 ready (supports union type hints; see examples below)\n- PHP 7.1+ compatible\n- Recursive dependencies autowiring\n- Semver\n- Tests\n\n\n## Installation\n\nUse [Composer][2] package manager to add *Technically\\DependencyResolver* to your project:\n\n```\ncomposer require technically/dependency-resolver\n```\n\n\n## Example\n\n```php\n\u003c?php\n\nfinal class MyFancyService \n{\n    public function __construct(callable|LoggerInterface $log) \n    {\n        // initialize\n    }\n}\n\n// Construct service instance, providing dependencies in-place:\n$resolver = new DependencyResolver();\n$service = $resolver-\u003econstruct(MyFancyService::class, [\n    'log' =\u003e function (string $priority, string $message) {\n        error_log(\"[$priority]: $message\");\n    }]\n);\n\n// Resolve service instance from container, falling back to `construct()` otherwise.\n$resolver = new DependencyResolver($container);\n$service = $resolver-\u003eresolve(MyFancyService::class);\n\n\n```\n\n\n## Changelog\n\nAll notable changes to this project will be documented in the [CHANGELOG](./CHANGELOG.md) file.\n\n\n## Credits\n\n- Implemented by :space_invader: [Ivan Voskoboinyk][3]\n- Heavily inspired by Dawid Kraczkowski's work in [igniphp/container][4]\n\n[1]: https://www.php-fig.org/psr/psr-11/\n[2]: https://getcomposer.org/\n[3]: https://github.com/e1himself?utm_source=web\u0026utm_medium=github\u0026utm_campaign=technically/dependency-resolver\n\n[4]: https://github.com/igniphp/container\n[badge]: https://github.com/technically-php/dependency-resolver/actions/workflows/test.yml/badge.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnically-php%2Fdependency-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnically-php%2Fdependency-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnically-php%2Fdependency-resolver/lists"}