Skip to content

added method "callable", bugfixed

Compare
Choose a tag to compare
@ytake ytake released this 04 Nov 18:18
· 22 commits to master since this release
3efd9f2

callable

returns the value of a callable with parameters supplied at calltime.

final class TestingInvokable {
  public function __invoke(FactoryContainer $container): int {
    return 1;
  }
}

$container = new \Ytake\HHContainer\FactoryContainer();
$container->set(TestingInvokable::class, $container ==> 
  $container->callable(
    new \Ytake\HHContainer\Invokable(
      new TestingInvokable(), '__invoke', $container
    )
  )
);

for zend expressive, and more