PHPackages                             arnaud-23/attribute-execution-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. [Framework](/categories/framework)
4. /
5. arnaud-23/attribute-execution-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

arnaud-23/attribute-execution-bundle
====================================

Generic attribute-based execution pipeline for Symfony services.

1.0.0(11mo ago)03MITPHPPHP ^8.2CI passing

Since Jun 16Pushed 11mo agoCompare

[ Source](https://github.com/arnaud-23/attribute-execution-bundle)[ Packagist](https://packagist.org/packages/arnaud-23/attribute-execution-bundle)[ RSS](/packages/arnaud-23-attribute-execution-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (25)Versions (2)Used By (0)

AttributeExecutionBundle
========================

[](#attributeexecutionbundle)

[![CI](https://github.com/arnaud-23/attribute-execution-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/arnaud-23/attribute-execution-bundle/actions/workflows/ci.yml)[![PHPStan](https://camo.githubusercontent.com/f60d96f7c2579690ab6dfa8918f777fe93a02a92301c661eb38a85861a92b780/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org)[![PHP Version](https://camo.githubusercontent.com/0f16581d1180dbfd4c0e13166ec1267d4ad2f2fab8281ea6d6b284cf5c65d921/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c75652e737667)](https://php.net)[![Symfony Version](https://camo.githubusercontent.com/79d142b34f66ded41a331e8c34e12052b5021c6c4cfee58de753d3019a80d34a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d362e302532422d626c75652e737667)](https://symfony.com)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Code Coverage](https://camo.githubusercontent.com/cd269e752ad8612d79c90895c6d96ab6b46b8fcf2f92890711c75ce2e1777dfb/68747470733a2f2f636f6465636f762e696f2f67682f61726e6175642d32332f6174747269627574652d657865637574696f6e2d62756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/arnaud-23/attribute-execution-bundle)

Generic attribute execution system for Symfony.

Features
--------

[](#features)

- Attribute-based middleware pipeline
- Built-in middleware for:
    - Security (role-based access control)
    - Cache (with configurable strategies)
    - Transaction management
- Extensible architecture for custom middleware
- High test coverage
- Static analysis with PHPStan level 8
- PSR-12 compliant code style

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

[](#installation)

```
composer require arnaud-23/attribute-execution-bundle
```

Setup
-----

[](#setup)

The bundle will be automatically registered in your Symfony application. No additional configuration is required to start using the attributes.

### Service Configuration

[](#service-configuration)

Services using the bundle's attributes are automatically configured with the attribute proxy. You don't need to add any additional tags or configuration.

```
# config/services.yaml
services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: false

    # Your services will be automatically configured when using attributes
    App\Service\YourService: ~
```

### Cache Configuration

[](#cache-configuration)

If you're using the cache attribute, you can configure the cache strategies in your configuration:

```
# config/packages/attribute_execution.yaml
attribute_execution:
    cache:
        strategies:
            array: ~  # Uses Symfony's ArrayAdapter
            redis:    # Uses Redis
                dsn: 'redis://localhost:6379'
                options:
                    prefix: 'app_cache_'
```

### Security Configuration

[](#security-configuration)

The security attribute requires the Symfony Security component to be installed:

```
composer require symfony/security-bundle
```

Usage
-----

[](#usage)

```
use Arnaud23\AttributeExecutionBundle\Attribute\Security;
use Arnaud23\AttributeExecutionBundle\Attribute\Cache;
use Arnaud23\AttributeExecutionBundle\Attribute\Transactional;

class YourService
{
    #[Security('ROLE_ADMIN')]
    #[Cache(strategy: 'redis', ttl: 3600)]
    #[Transactional('default')]
    public function yourMethod(): mixed
    {
        // Your code here
    }
}
```

### Available Attributes

[](#available-attributes)

#### Security

[](#security)

```
#[Security('ROLE_ADMIN')]  // Method or class level
```

#### Cache

[](#cache)

```
#[Cache]                    // Uses default strategy (array) with 300s TTL
#[Cache(strategy: 'custom')] // Uses custom strategy
#[Cache(ttl: 3600)]         // Custom TTL in seconds
```

#### Transaction

[](#transaction)

```
#[Transactional]            // Uses default connection
#[Transactional('custom')]  // Uses custom connection
```

Development
-----------

[](#development)

```
# Install dependencies
composer install

# Run tests
make test

# Run tests with coverage
make coverage

# Generate HTML coverage report
make coverage-html

# Run static analysis
make phpstan
```

Contributing
------------

[](#contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

Security
--------

[](#security-1)

If you discover any security-related issues, please email  instead of using the issue tracker. See our [Security Policy](SECURITY.md) for more details.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for a list of changes.

License
-------

[](#license)

This bundle is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Credits
-------

[](#credits)

- [Arnaud Lefevre](https://github.com/arnaud-23) - Creator and maintainer

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance52

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

336d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25dcc789b6c61fc8b0b25db6fe0d8d1617788e8bdfff9bee7145f51e97ddace0?d=identicon)[arnaud-23](/maintainers/arnaud-23)

---

Top Contributors

[![arnaud-23](https://avatars.githubusercontent.com/u/2587655?v=4)](https://github.com/arnaud-23 "arnaud-23 (25 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/arnaud-23-attribute-execution-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/arnaud-23-attribute-execution-bundle/health.svg)](https://phpackages.com/packages/arnaud-23-attribute-execution-bundle)
```

###  Alternatives

[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k235.4M9.7k](/packages/symfony-framework-bundle)[shopware/platform

The Shopware e-commerce core

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

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

1.3k1.3M152](/packages/sulu-sulu)[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)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[shopware/storefront

Storefront for Shopware

684.2M148](/packages/shopware-storefront)

PHPackages © 2026

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