PHPackages                             delormejonathan/accessible - 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. delormejonathan/accessible

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

delormejonathan/accessible
==========================

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

v3.2(6y ago)0611MITPHPPHP &gt;=5.4.0

Since Nov 16Pushed 6y agoCompare

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

READMEChangelog (1)Dependencies (6)Versions (12)Used By (1)

Accessible
==========

[](#accessible)

[![SensioLabsInsight](https://camo.githubusercontent.com/5b47e721cac6614fcbed4d1532da5586d8d2d6da9aff8bc66a2ed19527f991cb/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64303739316239382d636439362d343533612d626638392d3339646463633637326339382f6d696e692e706e67)](https://insight.sensiolabs.com/projects/d0791b98-cd96-453a-bf89-39ddcc672c98)[![Build Status](https://camo.githubusercontent.com/c0d76096e2641ac1db1f6e276ac5f5102a0bb27da31d0353b502953a0f2789e2/68747470733a2f2f7472617669732d63692e6f72672f616e7461726573747570696e2f41636365737369626c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/antarestupin/Accessible)[![Code Coverage](https://camo.githubusercontent.com/a4994b384793e37d7095d68989503221c1f46e347d9defb3d01c02d5afa78ade/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e74617265733939332f41636365737369626c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/antares993/Accessible/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/347bb2281544a425772a73c11b348a0304fd0bf566d1194cb6d804e90e20a708/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e74617265733939332f41636365737369626c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/antares993/Accessible/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/1a8647dac285a0ff39dc9852593b21b6e6b47a66ec95810a2e0d2ad639d69297/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537323238343931626133376365303034333039656362332f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/57228491ba37ce004309ecb3)[![Latest Stable Version](https://camo.githubusercontent.com/477c41f1baa2a3bb6646cfbd8d61b3fec65f42b8b6db999b32b769d067025ea6/68747470733a2f2f706f7365722e707567782e6f72672f616e74617265732f61636365737369626c652f762f737461626c65)](https://packagist.org/packages/antares/accessible)[![License](https://camo.githubusercontent.com/bd74caee50a901f82d02bf89ed20f9ba0effd6fe56287e74f6ed73ad3af667a4/68747470733a2f2f706f7365722e707567782e6f72672f616e74617265732f61636365737369626c652f6c6963656e7365)](https://packagist.org/packages/antares/accessible)

Accessible is a PHP library that allows you to define your class behavior in an elegant and powerful way using docblock annotations.

This way, you can define your class' getters, setters and constructor, and automate collections and association management.

Here is a (very) basic example with getters and setters:

```
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
```

Another example using collections related annotations:

```
class Server
{
  use AutomatedBehaviorTrait;

  /**
   * @Access({Access::GET})
   * @InitializeObject(ArrayCollection::class)
   * @ListBehavior
   */
  private $processes;
}

$server = new Server();

$server->getProcesses(); // Instance of ArrayCollection
$process = new Process();
$server->addProcess($process);
$server->removeProcess($process);
```

More complex examples are available in the doc.

What this library can manage in your classes:

- Getters and setters
- Validation on setters parameters using Symfony's Assertion annotations
- Constructor and properties initialization
- Collections
- Associations between classes

**Suggestions and contributions are welcome!**

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

[](#documentation)

- [How to define getters and setters](https://github.com/antares993/Accessible/tree/master/doc/accessible.md)
- [How to define the class constructor and the properties initialization](https://github.com/antares993/Accessible/tree/master/doc/auto-construct.md)
- [How to enable / disable the constraints validation](https://github.com/antares993/Accessible/tree/master/doc/constraints-validation.md)
- [How to manage collections](https://github.com/antares993/Accessible/tree/master/doc/collections.md)
- [How to manage associations](https://github.com/antares993/Accessible/tree/master/doc/associations.md)
- [How to modify the default configuration](https://github.com/antares993/Accessible/tree/master/doc/configuration.md)
- [Compatibility issues (and how to solve them)](https://github.com/antares993/Accessible/tree/master/doc/compatibility.md)

Install
-------

[](#install)

If you want to use this library in your Symfony project, take a look at [AccessibleBundle](https://github.com/antares993/AccessibleBundle).

You can add this library as a dependency using composer this way:

```
composer require antares/accessible

```

This library uses the Doctrine annotations library, so if it is not already done you must register the Composer loader in the annotation registry:

```
$loader = require __DIR__ . '/vendor/autoload.php';
Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
```

You may want to change the default configuration, to do this see the [Configuration dedicated page](https://github.com/antares993/Accessible/tree/master/doc/configuration.md).

Compatibility
-------------

[](#compatibility)

This library is compatible with PHP 5.4+, PHP 7 and HHVM.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 99.4% 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 ~181 days

Recently: every ~387 days

Total

10

Last Release

2247d ago

Major Versions

v1.0.1 → v2.02016-02-08

v2.1.1 → v3.02016-03-05

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

classsetaccesspropertiesgetgettersetterannotationpopopojo

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[antares/accessible

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

123.9k1](/packages/antares-accessible)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[antares/accessible-bundle

A bundle to easily use Accessible in Symfony projects.

153.8k](/packages/antares-accessible-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[akeneo/pim-community-dev

Akeneo PIM, the future of catalog management is open!

1.0k624.1k86](/packages/akeneo-pim-community-dev)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

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