Login   Register  
PHP Classes
elePHPant
Icontem

File: src/eMacros/Runtime/PHPFunction.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2014-01-13 05:17
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);
    }
}
?>