コード例 #1
0
 static function defStatic($name, $closure)
 {
     $table = get_called_class();
     if (!DispatchTable::tableExists($table)) {
         DispatchTable::createTable($table);
     }
     DispatchTable::addToTable($table, $name, rawr_reduce($closure, rawr_callable));
 }
コード例 #2
0
ファイル: test.php プロジェクト: rawr-php/rawr-development
<?php

require_once 'src/Core/rawr_core_functions.php';
require_once 'src/Core/DispatchTable.php';
require_once 'src/DataType/BaseType.php';
require_once 'src/DataType/Action.php';
require_once 'src/DataType/Bool.php';
require_once 'src/DataType/Int.php';
use Rawr\Core\DispatchTable;
use Rawr\DataType\BaseType;
use Rawr\DataType\Action;
use Rawr\DataType\Bool;
use Rawr\DataType\Int;
Action::defStatic("helloWorld", function ($name) {
    echo "Hello {$name}", PHP_EOL;
});
var_dump(DispatchTable::__GET__());