PHPackages                             icanboogie/prototype - 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. icanboogie/prototype

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

icanboogie/prototype
====================

Implements the Prototype design pattern; getters/setters

v5.1.0(3y ago)411.0k↓77.8%5BSD-3-ClausePHPPHP &gt;=7.2.5CI failing

Since Oct 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ICanBoogie/Prototype)[ Packagist](https://packagist.org/packages/icanboogie/prototype)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-prototype/feed)WikiDiscussions 6.0 Synced 3w ago

READMEChangelog (4)Dependencies (3)Versions (14)Used By (5)

Prototype
=========

[](#prototype)

[![Release](https://camo.githubusercontent.com/1bd3558b18a4c768d3c9690ae09621933aca2153438355ff23fa05782e4d70ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4943616e426f6f6769652f50726f746f747970652e737667)](https://packagist.org/packages/icanboogie/prototype)[![Code Coverage](https://camo.githubusercontent.com/aa1bcd2ddc17a2b2bc273c85308e773fa813a000872e2ff27fa0c7cbe9b80731/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943616e426f6f6769652f50726f746f747970652f62616467652e7376673f6272616e63683d362e30)](https://coveralls.io/r/ICanBoogie/Prototype?branch=6.0)[![Downloads](https://camo.githubusercontent.com/cacd1301dfdf3f278254b32dcb4410ed3a9c8e062c8221597b61d4c6ce0f16d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6963616e626f6f6769652f70726f746f747970652e737667)](https://packagist.org/packages/icanboogie/prototype)

The **icanboogie/prototype** package allows methods of classes using the [PrototypeTrait](https://icanboogie.org/api/prototype/4.0/class-ICanBoogie.PrototypeTrait.html) to be defined at runtime, and since the [icanboogie/accessor](https://github.com/ICanBoogie/Accessor) package is used, this also includes getters and setters.

#### Installation

[](#installation)

```
composer require icanboogie/prototype
```

Defining methods at runtime
---------------------------

[](#defining-methods-at-runtime)

Methods can be defined at runtime using the *prototype* of a class. They are immediately available to every instance of the class and are inherited by the sub-classes of that class.

```
