- PHP 8.1+
- Added
Prototype::has_method()
. - Added
Prototype::add_method()
. - Added
Prototype::call()
.
Prototype::bind()
requires aConfig
objects instead of an array.
<?php
namespace ICanBoogie;
Prototype::bind([
Cat::class => [
'meow' => fn(Cat $cat) => 'Meow'
],
FierceCat::class => [
'meow' => fn(FierceCat $cat) => 'MEOOOW !'
]
]);
<?php
namespace ICanBoogie;
use ICanBoogie\Prototype\ConfigBuilder;use ICanBoogie\PrototypeTest\FierceCat;
$config = (new ConfigBuilder())
->bind(Cat::class, 'meom', fn(Cat $cat) => 'Meow')
->bind(FierceCat::class, 'meow', fn(FierceCat $cat) => 'MEOOOW !')
->build();
ICanBoogie\Prototype::bind($config);
-
The parameter
$class_name
is no longer supported onPrototyped::from()
. -
Removed the
prototype
property fromPrototypeTrait
.
None
Prototyped::from()
returnsstatic
.