public function switch(string $name, array $args) /*:  \Pho\Lib\Graph\EntityInterface*/
    {
        $method = function(string $key) {
            return $this->adapters[$key] . "::handle";
        };

        if(in_array($name, $this->cargo_out->setter_labels)) {
            return call_user_func(
                $method("set"), 
                $this->particle, $this->pack(), $name, $args
            );
        }
        elseif(in_array($name, $this->cargo_out->formative_labels)) {
            return call_user_func(
                $method("form"), 
            $this->particle, $this->pack(), $name, $args);
        }
        elseif(strlen($name) > 3) {
            $func_prefix = substr($name, 0, 3);
            if (array_key_exists($func_prefix, $this->adapters) ) {
                try {
                    return call_user_func(
                        $method($func_prefix), 
                        $this->particle, $this->pack(), $name, $args
                    );
                }
                catch(\Exception $e) {
                    throw $e;
                }
            }
        }
        throw new InvalidParticleMethodException(get_class($this->particle), $name, (string) $this->particle->id());
    }
public function switch(string $name, array $args) /*:  \Pho\Lib\Graph\EntityInterface*/
    {
        $method = function(string $key) {
            return $this->adapters[$key] . "::handle";
        };

        if(in_array($name, $this->cargo_out->setter_labels)) {
            return call_user_func(
                $method("set"), 
                $this->particle, $this->pack(), $name, $args
            );
        }
        elseif(in_array($name, $this->cargo_out->formative_labels)) {
            return call_user_func(
                $method("form"), 
            $this->particle, $this->pack(), $name, $args);
        }
        elseif(strlen($name) > 3) {
            $func_prefix = substr($name, 0, 3);
            if (array_key_exists($func_prefix, $this->adapters) ) {
                try {
                    return call_user_func(
                        $method($func_prefix), 
                        $this->particle, $this->pack(), $name, $args
                    );
                }
                catch(\Exception $e) {
                    throw $e;
                }
            }
        }
        throw new InvalidParticleMethodException(get_class($this->particle), $name, (string) $this->particle->id());
    }
public function switch ( string $ name , array $ args ) /*:  \Pho\Lib\Graph\EntityInterface*/ { $ method = function ( string $ key ) { return $ this -> adapters [ $ key ] . "::handle" ; } ; if ( in_array ( $ name , $ this -> cargo_out -> setter_labels ) ) { return call_user_func ( $ method ( "set" ) , $ this -> particle , $ this -> pack ( ) , $ name , $ args ) ; } elseif ( in_array ( $ name , $ this -> cargo_out -> formative_labels ) ) { return call_user_func ( $ method ( "form" ) , $ this -> particle , $ this -> pack ( ) , $ name , $ args ) ; } elseif ( strlen ( $ name ) > 3 ) { $ func_prefix = substr ( $ name , 0 , 3 ) ; if ( array_key_exists ( $ func_prefix , $ this -> adapters ) ) { try { return call_user_func ( $ method ( $ func_prefix ) , $ this -> particle , $ this -> pack ( ) , $ name , $ args ) ; } catch ( \ Exception $ e ) { throw $ e ; } } } throw new InvalidParticleMethodException ( get_class ( $ this -> particle ) , $ name , ( string ) $ this -> particle -> id ( ) ) ; }
Catch-call handler switch

Decides what static class to call for the given catch-all method.

@param string $name Catch-all method name.
@param array $args Catch-all method arguments.

@return mixed

@throws \Pho\Framework\Exceptions\InvalidParticleMethodException when the given method does not match with anything.
@throws \InvalidArgumentException thrown when there argument does not meet the constraints.
Catch - call handler switch