src/Plugin/Stub.php
public static function find($references, $method = null, $args = null)
    {
        $references = (array) $references;
        $stub = null;
        foreach ($references as $reference) {
            $hash = Suite::hash($reference);
            if (!isset(static::$_registered[$hash])) {
                continue;
            }
            $stubs = static::$_registered[$hash]->methods();

            if (!isset($stubs[$method])) {
                continue;
            }

            foreach ($stubs[$method] as $stub) {
                $call['name'] = $method;
                $call['args'] = $args;
                if ($stub->match($call)) {
                    return $stub;
                }
            }
        }
        return false;
    }
public static function find($references, $method = null, $args = null)
    {
        $references = (array) $references;
        $stub = null;
        foreach ($references as $reference) {
            $hash = Suite::hash($reference);
            if (!isset(static::$_registered[$hash])) {
                continue;
            }
            $stubs = static::$_registered[$hash]->methods();

            if (!isset($stubs[$method])) {
                continue;
            }

            foreach ($stubs[$method] as $stub) {
                $call['name'] = $method;
                $call['args'] = $args;
                if ($stub->match($call)) {
                    return $stub;
                }
            }
        }
        return false;
    }
public static function find ( $ references , $ method = null , $ args = null ) { $ references = ( array ) $ references ; $ stub = null ; foreach ( $ references as $ reference ) { $ hash = Suite :: hash ( $ reference ) ; if ( ! isset ( static :: $ _registered [ $ hash ] ) ) { continue ; } $ stubs = static :: $ _registered [ $ hash ] -> methods ( ) ; if ( ! isset ( $ stubs [ $ method ] ) ) { continue ; } foreach ( $ stubs [ $ method ] as $ stub ) { $ call [ 'name' ] = $ method ; $ call [ 'args' ] = $ args ; if ( $ stub -> match ( $ call ) ) { return $ stub ; } } } return false ; }
Finds a stub.

@param  mixed       $references An instance or a fully namespaced class name.
or an array of that.
@param  string      $method     The method name.
@param  array       $args       The required arguments.
@return object|null             Return the subbed method or `null` if not founded.
Finds a stub .