Skip to content

0.1.0

@fpoirotte fpoirotte tagged this 06 Apr 19:16
Current features:
- An interface for a callable object (i.e. an object that
  implements the __invoke() magical method).
  See \Erebot\CallableInterface for more information.
  This interface can be used as a replacement type-hint
  on PHP 5.3 to ensure a callable object is passed to a
  function/method

- A wrapper around the "callable" typehint, with support
  for all forms of callable objects PHP supports (functions,
  methods, invocable objects, closures, etc.).

  Use \Erebot\CallableWrapper::wrap($callable) to wrap a
  callable. The wrapper can then be used instead of the
  original callable. The wrapper implements the interface
  above.

- An experimental drop-in replacement for the callable
  typehint on PHP 5.3. Using this, you can use the regular
  "callable" typehint introduced in PHP 5.4 in your code.
  The typehint will auto-magically be aliased to the
  \Erebot\CallableInterface described above.

  \Erebot\CallableWrapper::initialize() must be called
  before this replacement typehint can be used.
  You may also need to call this method again during code
  execution for newly loaded classes & functions to work
  properly.
Assets 2
Loading