{"id":17865792,"url":"https://github.com/ttskch/ttskchraydibundle","last_synced_at":"2025-04-02T21:43:25.216Z","repository":{"id":57073391,"uuid":"51655709","full_name":"ttskch/TtskchRayDiBundle","owner":"ttskch","description":"Integration of Ray.Di into Symfony.","archived":false,"fork":false,"pushed_at":"2016-09-26T07:18:45.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T12:16:14.414Z","etag":null,"topics":[],"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/ttskch.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-02-13T17:07:48.000Z","updated_at":"2016-09-26T07:07:56.000Z","dependencies_parsed_at":"2022-08-24T14:54:40.742Z","dependency_job_id":null,"html_url":"https://github.com/ttskch/TtskchRayDiBundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2FTtskchRayDiBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2FTtskchRayDiBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2FTtskchRayDiBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2FTtskchRayDiBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttskch","download_url":"https://codeload.github.com/ttskch/TtskchRayDiBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246899639,"owners_count":20851893,"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":[],"created_at":"2024-10-28T09:25:01.058Z","updated_at":"2025-04-02T21:43:25.189Z","avatar_url":"https://github.com/ttskch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TtskchRayDiBundle\n\n[![Build Status](https://travis-ci.org/ttskch/TtskchRayDiBundle.svg?branch=master)](https://travis-ci.org/ttskch/TtskchRayDiBundle)\n[![Latest Stable Version](https://poser.pugx.org/ttskch/ray-di-bundle/version)](https://packagist.org/packages/ttskch/ray-di-bundle)\n[![Total Downloads](https://poser.pugx.org/ttskch/ray-di-bundle/downloads)](https://packagist.org/packages/ttskch/ray-di-bundle)\n\nIntegration of [Ray.Di](https://github.com/ray-di/Ray.Di) into Symfony.\n\n## Getting started\n\n#### 1. Composer-require\n\n```bash\n$ composer require ttskch/ray-di-bundle\n```\n\n#### 2. Register with AppKernel\n\n```php\n// app/AppKernel.php\n\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = [\n            // ...\n            new Ttskch\\RayDiBundle\\TtskchRayDiBundle(),\n        ];\n        // ...\n    }\n    // ...\n}\n```\n\n#### 3. Configure via config.yml\n\n```yml\n# app/config/config.yml\n\nttskch_ray_di:\n    module_class: 'Foo\\BarModule'   # FQCN of your main Ray.Di `module`\n```\n\n## Usage\n\nWhen you configure your `module`...\n\n```php\nclass AppModule extends AbstractModule\n{\n    public function configure()\n    {\n        $this-\u003ebind(SomeServiceInterface::class)-\u003eto(SomeServiceConcrete::class);\n    }\n}\n```\n\nThen you can get `injector` from Symfony container like as below:\n\n```php\nclass SomeController extends Controller\n{\n    public function indexAction()\n    {\n        /** @var \\Ray\\Di\\Injector $injector */\n        $injector = $this-\u003eget('ttskch_ray_di.injector');\n\n        $someService = $injector-\u003egetInstance(SomeServiceInterface::class);\n\n        return new Response($someService-\u003esomeMethod());\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttskch%2Fttskchraydibundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttskch%2Fttskchraydibundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttskch%2Fttskchraydibundle/lists"}