PHPackages                             hostnet/accessor-generator-plugin-lib - 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. hostnet/accessor-generator-plugin-lib

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

hostnet/accessor-generator-plugin-lib
=====================================

Generate get, set, add, remove methods on the fly.

6.2.1(3w ago)10121.4k↓13.5%9MITPHPPHP ^8.3CI passing

Since Nov 6Pushed 3w ago2 watchersCompare

[ Source](https://github.com/hostnet/accessor-generator-plugin-lib)[ Packagist](https://packagist.org/packages/hostnet/accessor-generator-plugin-lib)[ RSS](/packages/hostnet-accessor-generator-plugin-lib/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (26)Versions (101)Used By (0)

Welcome to the Accessor Generator composer plugin.

Goals
-----

[](#goals)

The goal of this plugin is to provide dynamically generated get, set, add, remove accessor methods for Classes based on information that we can read from PHP 8 native attributes or from doc comments. Currently we can process Doctrine ORM annotations and their native attribute equivalents.

Since the code is automatically generated you do not have to (unit) test it and it will be very consistent with a lot of added boilerplate code that will make your code fail early if you happen to use the wrong type or number of arguments with the generated functions.

Limitations
-----------

[](#limitations)

- Imports through grouped `use` statements is not supported. ([https://wiki.php.net/rfc/group\_use\_declarations](https://wiki.php.net/rfc/group_use_declarations))

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

[](#installation)

Add `hostnet/accessor-generator-plugin-lib` to your `composer.json` and run `composer require hostnet/accessor-generator-plugin-lib`

If you want to invoke generation after installing you can run `php composer.phar dump-autoload`. Add `-vv` to the dump-autoload command for more verbosity.

Usage
-----

[](#usage)

```
