src/Vectorface/SnappyRouter/Handler/CliTaskHandler.php
public function isAppropriate($components)
    {
        $components = array_values(array_filter(array_map('trim', $components), 'strlen'));
        $this->options = array();
        if (count($components) < 5) {
            return false;
        }

        if ($components[1] !== '--task' || $components[3] !== '--action') {
            return false;
        }
        $this->options['task'] = $components[2];
        $this->options['action'] = $components[4];

        try {
            // ensure we have this task registered
            $this->getServiceProvider()->get($this->options['task']);
        } catch (Exception $e) {
            return false;
        }

        return true;
    }
public function isAppropriate($components)
    {
        $components = array_values(array_filter(array_map('trim', $components), 'strlen'));
        $this->options = array();
        if (count($components) < 5) {
            return false;
        }

        if ($components[1] !== '--task' || $components[3] !== '--action') {
            return false;
        }
        $this->options['task'] = $components[2];
        $this->options['action'] = $components[4];

        try {
            // ensure we have this task registered
            $this->getServiceProvider()->get($this->options['task']);
        } catch (Exception $e) {
            return false;
        }

        return true;
    }
public function isAppropriate ( $ components ) { $ components = array_values ( array_filter ( array_map ( 'trim' , $ components ) , 'strlen' ) ) ; $ this -> options = array ( ) ; if ( count ( $ components ) < 5 ) { return false ; } if ( $ components [ 1 ] !== '--task' || $ components [ 3 ] !== '--action' ) { return false ; } $ this -> options [ 'task' ] = $ components [ 2 ] ; $ this -> options [ 'action' ] = $ components [ 4 ] ; try { // ensure we have this task registered $ this -> getServiceProvider ( ) -> get ( $ this -> options [ 'task' ] ) ; } catch ( Exception $ e ) { return false ; } return true ; }
Determines whether the current handler is appropriate for the given
path components.
@param array $components The path components as an array.
@return boolean Returns true if the handler is appropriate and false
otherwise.
Determines whether the current handler is appropriate for the given path components .