breux/prototype

This package is abandoned and no longer maintained. No replacement package was suggested.

PHP 5.4 - Prototype

1.0 2013-01-06 18:17 UTC

This package is not auto-updated.

Last update: 2020-01-24 14:47:10 UTC


README

Build Status Scrutinizer Quality Score Code Coverage

Play with prototype in PHP 5.4!

Example

Class

class Foo
{
	use Prototype\Prototype;
}

Add prototype to object (and others objects)

$foo = new Foo;

$foo->saidHello = function($lastName)
{
	return "Hello $lastName";
};

echo $foo->saidHello('Julien');

Add prototype to class (for all objects)

Foo::prototype('saidHello', function($lastName)
{
  return "Hello $lastName";
});

Usage

$bar = new Foo;

echo $bar->saidHello('Laura');