PHP Classes

File: src/eMacros/Runtime/PHPFunction.php

Recommend this page to a friend!
  Classes of Emmanuel Antico   eMacros   src/eMacros/Runtime/PHPFunction.php   Download  
File: src/eMacros/Runtime/PHPFunction.php
Role: Class source
Content type: text/plain
Description: Class source
Class: eMacros
PHP LISP language interpreter
Author: By
Last change:
Date: 10 years ago
Size: 469 bytes
 

Contents

Class file image Download
<?php
namespace eMacros\Runtime;

class
PHPFunction extends GenericFunction {
   
/**
     * Internal callback
     * @var callable
     */
   
public $callback;
   
    public function
__construct($callback) {
        if (!
is_callable($callback)) {
            throw new \
UnexpectedValueException('PHPFunction: Argument is not a valid callback.');
        }
       
       
$this->callback = $callback;
    }
   
    public function
execute(array $arguments) {
        return
call_user_func_array($this->callback, $arguments);
    }
}
?>