Jyxo\Rpc\Server::registerFunc PHP Méthode

registerFunc() public méthode

Registers given function.
public registerFunc ( string $func ) : self
$func string Function name
Résultat self
    public function registerFunc(string $func) : self
    {
        if (!function_exists($func)) {
            throw new \InvalidArgumentException(sprintf('Function %s does not exist.', $func));
        }
        $this->register($func);
        return $this;
    }

Usage Example

Exemple #1
0
 /**
  * Tests registering a non-existent function.
  */
 public function testRegisterNonExistingFunction()
 {
     $this->setExpectedException('\\InvalidArgumentException');
     $this->rpc->registerFunc('dummy');
 }
All Usage Examples Of Jyxo\Rpc\Server::registerFunc