2017 © Pedro Peláez
 

library callback_resolver

Callable Resolver

image

apatis/callback_resolver

Callable Resolver

  • Sunday, January 28, 2018
  • by apatis
  • Repository
  • 0 Watchers
  • 0 Stars
  • 56 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Callback Resolver

Resolve callable value, (*1)

<?php
use \Apatis\CallbackResolver\CallbackResolver;

// use null to bind closure to null
$bind = null;
$resolveStaticMethod = true;
$resolver = new CallbackResolver($bind, $resolveStaticMethod);

$callable_1 = $resolver->resolve('Class:method');
// Class:method is equal with Class->method
// Method operator use 
$callable_2 = $resolver->resolve('Class->method');

$callable_closure = $resolver->resolve(function() {
   /**
    * @var null $this
    * even callable inside of Object
    * When binding set to null it will bind into null
    */
});
// set Bind to \stdClass
$resolver->setBinding(new stdClass());
$callable_closure_std_class = $resolver->resolve(function() {
   /**
    * @var \stdClass $this
    * after binding set into \stdClass
    * the variable $this will be accessible info \stdClass 
    */
});

OPERATOR

 - Use operator single `:` or `->` to determine that class need to be new instance
 - Use double `:` (eg : 'class::method') to determine that method is static 
        or will be convert like a (standard) `->` operator if method is non static
        and set as resolve static method

The Versions

28/01 2018

dev-master

9999999-dev

Callable Resolver

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

28/01 2018

1.0.5

1.0.5.0

Callable Resolver

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

21/12 2017

1.0.1

1.0.1.0

Callable Resolver

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

15/12 2017

1.0.0

1.0.0.0

Callable Resolver

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires