PHPackages                             openclassrooms/use-case-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. openclassrooms/use-case-bundle

ActiveSymfony-bundle

openclassrooms/use-case-bundle
==============================

Symfony Bundle for OpenClassrooms UseCase

v5.0.0(2mo ago)4408.4k↑44.7%1[1 PRs](https://github.com/OpenClassrooms/UseCaseBundle/pulls)MITPHPPHP &gt;=8.3CI passing

Since Dec 13Pushed 2mo ago20 watchersCompare

[ Source](https://github.com/OpenClassrooms/UseCaseBundle)[ Packagist](https://packagist.org/packages/openclassrooms/use-case-bundle)[ RSS](/packages/openclassrooms-use-case-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (20)Versions (23)Used By (0)

UseCaseBundle
=============

[](#usecasebundle)

[![Build Status](https://camo.githubusercontent.com/99455ab72c8d36dd0c78b2d92588874abde82acab90356f099c1e8c12c5c72d9/68747470733a2f2f7472617669732d63692e6f72672f4f70656e436c617373726f6f6d732f5573654361736542756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/OpenClassrooms/UseCaseBundle)[![SensioLabsInsight](https://camo.githubusercontent.com/1a6b7c016303cdbab90e6a034fa67554dc8c347954ab37078afe46fb72de7bc2/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35616332653938362d666461332d343964342d393532392d3463316239633735303562382f6d696e692e706e67)](https://insight.sensiolabs.com/projects/5ac2e986-fda3-49d4-9529-4c1b9c7505b8)[![Coverage Status](https://camo.githubusercontent.com/c016ccecd11ee5d9be763eeb8dfd5e1969ce6f2baa19f999db90f75c51d38878/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4f70656e436c617373726f6f6d732f5573654361736542756e646c652f62616467652e706e67)](https://coveralls.io/r/OpenClassrooms/UseCaseBundle)

UseCaseBundle provides OpenClassrooms\\UseCase Library in a Symfony2 context. UseCase Library provides facilities to manage technical code over a Use Case in a Clean / Hexagonal / Use Case Architecture.

- **Security access**
- **Cache management**
- **Transactional context**
- **Events**

The goal is to have only functional code on the Use Case and manage technical code in an elegant way using annotations.

For usage of UseCase Library, please see the UseCase Library [documentation](https://github.com/OpenClassrooms/UseCase/blob/master/README.md#usage).

Installation
------------

[](#installation)

This bundle can be installed using composer:

`composer require openclassrooms/use-case-bundle`or by adding the package to the composer.json file directly.

```
{
    "require": {
        "openclassrooms/use-case-bundle": "*"
    }
}
```

After the package has been installed, add the bundle to the AppKernel.php file:

```
// in AppKernel::registerBundles()
    $bundles = array(
        // ...
        new OpenClassrooms\Bundle\OpenClassroomsUseCaseBundle(),
        // ...
);
```

If cache facilities are needed, add the OpenClassrooms\\CacheBundle to the AppKernel.php file:

```
// in AppKernel::registerBundles()
    $bundles = array(
        // ...
        new OpenClassrooms\Bundle\CacheBundle\OpenClassroomsCacheBundle(),
        new OpenClassrooms\Bundle\UseCaseBundle\OpenClassroomsUseCaseBundle(),
        // ...
);
```

Configuration
-------------

[](#configuration)

UseCaseBundle requires no initial configuration.

This is the default configuration:

```
# app/config/config.yml
openclassrooms_use_case:
    security: security_context
    # an implementation of OpenClassrooms\UseCase\Application\Services\Security\Security
    transaction: doctrine.orm.entity_manager
    # an implementation of EntityManagerInterface or OpenClassrooms\UseCase\Application\Services\Transaction\Transaction
    event_sender: event_dispatcher
    # an implementation of EventDispatcherInterface or OpenClassrooms\UseCase\Application\Services\Event\EventSender
    event_factory: openclassrooms.use_case.event_factory
    # an implementation of OpenClassrooms\UseCase\Application\Services\Event\EventFactory
```

If cache facilities are needed, CacheBundle configuration MUST be set. See [documentation](https://github.com/OpenClassrooms/CacheBundle/blob/master/README.md#configuration) for more details.

Furthermore, **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.**

Usage
-----

[](#usage)

For usage of UseCase Library, please see the UseCase Library [documentation](https://github.com/OpenClassrooms/UseCase/blob/master/README.md#usage).

Add the tag `openclassrooms.use_case` to the use case declaration to enable UseCase Library facilities.

### Resources/config/services.xml

[](#resourcesconfigservicesxml)

```

        AProject\BusinessRules\UseCases\AUseCase

```

The different services used are those defined in the configuration file. For each tag and each facility, a specific service can be set:

```

```

- *security* parameter MUST be an implementation of OpenClassrooms\\UseCase\\Application\\Services\\Security\\Security
- *cache* parameter MUST be an implementation of OpenClassrooms\\Cache\\Cache\\Cache
- *transaction* parameter MUST be an implementation of EntityManagerInterface or OpenClassrooms\\UseCase\\Application\\Services\\Transaction\\Transaction
- *event-sender* parameter MUST be an implementation of EventDispatcherInterface or OpenClassrooms\\UseCase\\Application\\Services\\Event\\EventSender
- *event-factory* parameter MUST be an implementation of OpenClassrooms\\UseCase\\Application\\Services\\Event\\EventFactory

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance85

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~187 days

Recently: every ~143 days

Total

19

Last Release

75d ago

Major Versions

v1.0.0 → v2.0.02019-07-03

v2.3.1 → V3.0.02025-02-06

v3.0.1 → v4.0.02025-03-20

v4.0.0 → v5.0.02026-03-04

PHP version history (4 changes)v1.0.0PHP &gt;=5.5

v2.0.0PHP &gt;=7.1

V3.0.0PHP &gt;=8.2

v5.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/d82b0e2dcc1728eacb2b83c259311b5ea7c3253bd08f1341d45df79bdd9ba77a?d=identicon)[openclassrooms-admin](/maintainers/openclassrooms-admin)

![](https://www.gravatar.com/avatar/a4eaa1e2bd9272e248e28561739200cbcfd705cc4d3fec9d3e4d595f3dd12165?d=identicon)[romainkuzniak](/maintainers/romainkuzniak)

---

Top Contributors

[![kletord](https://avatars.githubusercontent.com/u/392556?v=4)](https://github.com/kletord "kletord (26 commits)")[![samokiss](https://avatars.githubusercontent.com/u/8625072?v=4)](https://github.com/samokiss "samokiss (8 commits)")[![sidux](https://avatars.githubusercontent.com/u/1242225?v=4)](https://github.com/sidux "sidux (6 commits)")[![DotnDev](https://avatars.githubusercontent.com/u/57391746?v=4)](https://github.com/DotnDev "DotnDev (6 commits)")[![Wilkins](https://avatars.githubusercontent.com/u/478570?v=4)](https://github.com/Wilkins "Wilkins (4 commits)")[![nenrici](https://avatars.githubusercontent.com/u/47222062?v=4)](https://github.com/nenrici "nenrici (3 commits)")[![alex-ception](https://avatars.githubusercontent.com/u/636722?v=4)](https://github.com/alex-ception "alex-ception (3 commits)")[![yassavic](https://avatars.githubusercontent.com/u/66954816?v=4)](https://github.com/yassavic "yassavic (2 commits)")[![prollandoc](https://avatars.githubusercontent.com/u/70900670?v=4)](https://github.com/prollandoc "prollandoc (2 commits)")

---

Tags

design

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/openclassrooms-use-case-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/openclassrooms-use-case-bundle/health.svg)](https://phpackages.com/packages/openclassrooms-use-case-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
