{"id":20338214,"url":"https://github.com/openclassrooms/usecasebundle","last_synced_at":"2025-07-10T01:44:29.654Z","repository":{"id":17601547,"uuid":"20405307","full_name":"OpenClassrooms/UseCaseBundle","owner":"OpenClassrooms","description":"Symfony2 Bundle for OpenClassrooms Use Case Library","archived":false,"fork":false,"pushed_at":"2025-03-20T14:16:45.000Z","size":147,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-11T23:11:44.255Z","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/OpenClassrooms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-02T13:44:30.000Z","updated_at":"2025-03-20T14:16:20.000Z","dependencies_parsed_at":"2024-08-06T15:50:23.506Z","dependency_job_id":null,"html_url":"https://github.com/OpenClassrooms/UseCaseBundle","commit_stats":{"total_commits":68,"total_committers":12,"mean_commits":5.666666666666667,"dds":0.5147058823529411,"last_synced_commit":"5bb2a7f8353a38d77b74e37aa0ac33841a11c29d"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenClassrooms%2FUseCaseBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenClassrooms%2FUseCaseBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenClassrooms%2FUseCaseBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenClassrooms%2FUseCaseBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenClassrooms","download_url":"https://codeload.github.com/OpenClassrooms/UseCaseBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492877,"owners_count":21113163,"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-11-14T21:12:03.201Z","updated_at":"2025-04-11T23:11:50.576Z","avatar_url":"https://github.com/OpenClassrooms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"UseCaseBundle\n=============\n[![Build Status](https://travis-ci.org/OpenClassrooms/UseCaseBundle.svg?branch=master)](https://travis-ci.org/OpenClassrooms/UseCaseBundle)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5ac2e986-fda3-49d4-9529-4c1b9c7505b8/mini.png)](https://insight.sensiolabs.com/projects/5ac2e986-fda3-49d4-9529-4c1b9c7505b8)\n[![Coverage Status](https://coveralls.io/repos/OpenClassrooms/UseCaseBundle/badge.png)](https://coveralls.io/r/OpenClassrooms/UseCaseBundle)\n\nUseCaseBundle provides OpenClassrooms\\UseCase Library in a Symfony2 context. \nUseCase Library provides facilities to manage technical code over a Use Case in a Clean / Hexagonal / Use Case Architecture.\n\n- **Security access**\n- **Cache management**\n- **Transactional context**\n- **Events**\n\nThe goal is to have only functional code on the Use Case and manage technical code in an elegant way using annotations.\n\nFor usage of UseCase Library, please see the UseCase Library [documentation](https://github.com/OpenClassrooms/UseCase/blob/master/README.md#usage).\n\n## Installation\nThis bundle can be installed using composer:\n\n```composer require openclassrooms/use-case-bundle```\nor by adding the package to the composer.json file directly.\n\n```json\n{\n    \"require\": {\n        \"openclassrooms/use-case-bundle\": \"*\"\n    }\n}\n```\n\nAfter the package has been installed, add the bundle to the AppKernel.php file:\n\n```php\n// in AppKernel::registerBundles()\n    $bundles = array(\n        // ...\n        new OpenClassrooms\\Bundle\\OpenClassroomsUseCaseBundle(),\n        // ...\n);\n```\nIf cache facilities are needed, add the OpenClassrooms\\CacheBundle to the AppKernel.php file:\n\n```php\n// in AppKernel::registerBundles()\n    $bundles = array(\n        // ...\n        new OpenClassrooms\\Bundle\\CacheBundle\\OpenClassroomsCacheBundle(),\n        new OpenClassrooms\\Bundle\\UseCaseBundle\\OpenClassroomsUseCaseBundle(),\n        // ...\n);\n```\n\n## Configuration\nUseCaseBundle requires no initial configuration.\n\nThis is the default configuration:\n```yaml\n# app/config/config.yml\nopenclassrooms_use_case:\n    security: security_context               \n    # an implementation of OpenClassrooms\\UseCase\\Application\\Services\\Security\\Security\n    transaction: doctrine.orm.entity_manager\n    # an implementation of EntityManagerInterface or OpenClassrooms\\UseCase\\Application\\Services\\Transaction\\Transaction\n    event_sender: event_dispatcher\n    # an implementation of EventDispatcherInterface or OpenClassrooms\\UseCase\\Application\\Services\\Event\\EventSender\n    event_factory: openclassrooms.use_case.event_factory\n    # an implementation of OpenClassrooms\\UseCase\\Application\\Services\\Event\\EventFactory\n```\n\nIf cache facilities are needed, CacheBundle configuration MUST be set. See [documentation](https://github.com/OpenClassrooms/CacheBundle/blob/master/README.md#configuration) for more details.\n\nFurthermore, **only needed services are used**. It means, for example, if only security is used, the others services will never be called. **Even if the services of the default configuration exist or not.**\n\n## Usage\n\nFor usage of UseCase Library, please see the UseCase Library [documentation](https://github.com/OpenClassrooms/UseCase/blob/master/README.md#usage).\n\nAdd the tag ```openclassrooms.use_case``` to the use case declaration to enable UseCase Library facilities.\n\n### Resources/config/services.xml\n\n```xml\n\u003c?xml version=\"1.0\" ?\u003e\n\n\u003ccontainer xmlns=\"http://symfony.com/schema/dic/services\"\n    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n    xsi:schemaLocation=\"http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd\"\u003e\n\n    \u003cparameters\u003e\n        \u003cparameter key=\"a_project.a_use_case.class\"\u003eAProject\\BusinessRules\\UseCases\\AUseCase\u003c/parameter\u003e\n    \u003c/parameters\u003e\n\n    \u003cservices\u003e\n        \u003cservice id=\"a_project.a_use_case\" class=\"a_project.a_use_case.class\"\u003e\n            \u003ctag name=\"openclassrooms.use_case\"/\u003e\n        \u003c/service\u003e\n    \u003c/services\u003e\n\u003c/container\u003e\n```\n\nThe different services used are those defined in the configuration file. \nFor each tag and each facility, a specific service can be set:\n\n```xml\n        \u003cservice id=\"a_project.a_use_case\" class=\"a_project.a_use_case.class\"\u003e\n            \u003ctag name=\"openclassrooms.use_case\" \n                    security=\"a.different.security_context\" \n                    cache=\"a.different.cache\" \n                    transaction=\"a.different.entity_manager\"\n                    event-sender=\"a.different.event_dipsatcher\"\n                    event-factory=\"a.different.event_factory\"/\u003e\n        \u003c/service\u003e\n```\n- *security* parameter MUST be an implementation of OpenClassrooms\\UseCase\\Application\\Services\\Security\\Security\n- *cache* parameter MUST be an implementation of OpenClassrooms\\Cache\\Cache\\Cache\n- *transaction* parameter MUST be an implementation of EntityManagerInterface or OpenClassrooms\\UseCase\\Application\\Services\\Transaction\\Transaction\n- *event-sender* parameter MUST be an implementation of EventDispatcherInterface or OpenClassrooms\\UseCase\\Application\\Services\\Event\\EventSender\n- *event-factory* parameter MUST be an implementation of OpenClassrooms\\UseCase\\Application\\Services\\Event\\EventFactory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclassrooms%2Fusecasebundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenclassrooms%2Fusecasebundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclassrooms%2Fusecasebundle/lists"}