PHPackages                             antares/accessible-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. antares/accessible-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

antares/accessible-bundle
=========================

A bundle to easily use Accessible in Symfony projects.

v1.2(10y ago)153.8k3MITPHPPHP &gt;=5.4.0

Since Nov 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/antares993/AntaresAccessibleBundle)[ Packagist](https://packagist.org/packages/antares/accessible-bundle)[ Docs](https://github.com/antares993/AntaresAccessibleBundle)[ RSS](/packages/antares-accessible-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

AccessibleBundle
================

[](#accessiblebundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/f2382a1899b60b190edd3bbbb6d1f064a1af966638cab5ec5a92c215e9901f98/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31343532306435352d623236312d343439332d626538612d6461653661636465373461362f6d696e692e706e67)](https://insight.sensiolabs.com/projects/14520d55-b261-4493-be8a-dae6acde74a6)[![Dependency Status](https://camo.githubusercontent.com/f24dba4ec2f797a3524404fb1b8a6fe4716bc0de029c0e4d42a1a6bceaf2bd7b/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537323238376337626133376365303034333039656363322f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/572287c7ba37ce004309ecc2)[![Latest Stable Version](https://camo.githubusercontent.com/fdf788a22d5977a9864bbf1a1668d2117219c5f9dbf08fca33fc2758dd2533cc/68747470733a2f2f706f7365722e707567782e6f72672f616e74617265732f61636365737369626c652d62756e646c652f762f737461626c65)](https://packagist.org/packages/antares/accessible-bundle)[![License](https://camo.githubusercontent.com/bd74caee50a901f82d02bf89ed20f9ba0effd6fe56287e74f6ed73ad3af667a4/68747470733a2f2f706f7365722e707567782e6f72672f616e74617265732f61636365737369626c652f6c6963656e7365)](https://packagist.org/packages/antares/accessible-bundle)

AccessibleBundle provides an [Accessible](https://github.com/antares993/Accessible) integration for your Symfony projects. This will allow you to define your class behavior using powerful annotations.

Here is a (very) basic example:

```
class Customer
{
  use AutomatedBehaviorTrait;

  /**
   * @Access({Access::GET, Access::SET})
   * @Assert\Email
   */
  private $email;
}

$bob = new Customer();

$bob->setEmail('bob@example.com');
$bob->getEmail(); // bob@example.com
$bob->setEmail('not an email address'); // throws an InvalidArgumentException
```

Here the library is used to generate getters and setters, but it can also be used to manage constructors, attributes initialization, collections and associations between classes!

**Suggestions and contributions are welcome!**

Documentation
-------------

[](#documentation)

This file contains everything you will need to use this bundle. For details on the use of the library, see the [Accessible page](https://github.com/antares993/Accessible).

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

[](#installation)

First add the bundle in your Composer dependencies:

```
composer require antares/accessible-bundle
```

Then, register the bundle in your kernel:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...

        new Antares\Bundle\AccessibleBundle\AntaresAccessibleBundle()
    );
}
```

In order to be compatible with the `PropertyAccess` component you should also add the following lines in your configuration:

```
# app/config/config.yml
framework:
  property_access:
    magic_call: true
```

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

[](#configuration)

The configuration of this bundle is quite simple, take a look:

```
# app/config/config.yml
antares_accessible:
    cache:
        enable: true # default: false
    constraints_validation:
        enable: false # default: true
        validate_initialize_values: true # default: %kernel.debug%
```

Note that you don't need to set the configuration as everything is already configured by default.

Here are the meanings of the configuration values:

- `cache.enable`: Do you want a cache driver to be used?
- `constraints_validation.enable`: Do you want your class setters to use constraints validation?
- `constraints_validation.validate_initialize_values`: Do you want the `@Initialize` and `@InitializeObject` values to be validated?

### Use a custom cache driver

[](#use-a-custom-cache-driver)

By default, instances of `Doctrine\Common\Cache\PhpFileCache` are used. If you have APC enabled, you should replace the cache driver. You can do it like this:

```
# app/config/services.yml

parameters:
    antares_accessible.cache_driver.class: Doctrine\Common\Cache\ApcCache

services:
    antares_accessible.cache.driver:
        class: "%antares_accessible.cache_driver.class%"
    antares_accessible.annotations.cache_driver:
        class: "%antares_accessible.cache_driver.class%"
```

- `antares_accessible.cache.driver` is the cache driver used by the library
- `antares_accessible.annotations.cache_driver` is the cache driver used by the library's annotation reader

### Use a custom annotations reader

[](#use-a-custom-annotations-reader)

You can use a custom annotations reader:

```
# app/config/services.yml

services:
    antares_accessible.annotations.reader:
        class: Doctrine\Common\Annotations\AnnotationReader
```

### Use a custom validator

[](#use-a-custom-validator)

You can also use a custom constraints validator, for example, if your project already uses the validator service, you can use it also with this library like this:

```
# app/config/services.yml

services:
    antares_accessible.constraints_validation.validator: '@validator'
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~54 days

Total

4

Last Release

3710d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55869ec69e18049202985f8d3581e805059bb843cef71f5a8eed3d1d7592ab0e?d=identicon)[antares993](/maintainers/antares993)

---

Top Contributors

[![antarestupin](https://avatars.githubusercontent.com/u/7022740?v=4)](https://github.com/antarestupin "antarestupin (31 commits)")

---

Tags

classsetpropertiesgetgettersetterannotationpopoaccessiblepojo

### Embed Badge

![Health badge](/badges/antares-accessible-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/antares-accessible-bundle/health.svg)](https://phpackages.com/packages/antares-accessible-bundle)
```

###  Alternatives

[antares/accessible

PHP library that allows you to define your class' getters, setters and constructor with docblock annotations.

123.9k1](/packages/antares-accessible)[usmanhalalit/get-set-go

Dynamic Setter-Getter for PHP 5.4+

1813.5k1](/packages/usmanhalalit-get-set-go)

PHPackages © 2026

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