2017 © Pedro Peláez
 

library hydrotron

Hydrotron aids in hydrating PHP objects

image

mrkrstphr/hydrotron

Hydrotron aids in hydrating PHP objects

  • Thursday, June 22, 2017
  • by mrkrstphr
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1,869 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 11 % Grown

The README.md

hydrotron

Hydrotron aids in hydrating PHP objects, (*1)

Installation

composer install mrkrstphr/hydrotron

Usage

When an array key exists, call one or more callbacks:, (*2)

$hydro = new Hydrotron(['foo' => 'bar']);
$hydro->when('foo', $callback, [$object, 'method']);

When an array key exists, instantiate an object, and call a series of callbacks with that object:, (*3)

$hydro = new Hydrotron(['foo' => 'bar', 'bizz' => 'buzz']);
$hydro->instantiateWhen('foo', MyClass::class, $callback);

instantiateWhen() uses Instantiator, which will analyze the classes constructor arguments and pass the values of any keys within the Hydrotron array that matches those argument names., (*4)

So if MyClass looked like:, (*5)

class MyClass {
    public function __construct($foo, $bizz) {}
}

MyClass would be instantiated with $foo = 'bar' and $bizz = 'buzz'. If an argument name is not found within the array, null will be passed., (*6)

Credits

Hydrotron was inspired by Keyper., (*7)

The Versions

22/06 2017

dev-php55

dev-php55

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

22/06 2017

1.3.0

1.3.0.0

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

22/06 2017

1.2

1.2.0.0

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

19/04 2017

dev-master

9999999-dev

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

19/04 2017

2.1.0

2.1.0.0

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

19/04 2017

1.1.0

1.1.0.0

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

13/04 2017

1.0.0

1.0.0.0

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

13/04 2017

2.0.0

2.0.0.0

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

07/03 2016

0.1.0

0.1.0.0

Hydrotron aids in hydrating PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires