src/Mock/Handle/HandleTrait.php
public function stub(string $name, bool $isNewRule = true): StubVerifier
    {
        $key = strtolower($name);

        if (isset($this->state->stubs->$key)) {
            $stub = $this->state->stubs->$key;
        } else {
            $stub = $this->state->stubs->$key = $this->createStub($name);
        }

        if ($isNewRule) {
            $stub->closeRule();
        }

        return $stub;
    }
public function stub(string $name, bool $isNewRule = true): StubVerifier
    {
        $key = strtolower($name);

        if (isset($this->state->stubs->$key)) {
            $stub = $this->state->stubs->$key;
        } else {
            $stub = $this->state->stubs->$key = $this->createStub($name);
        }

        if ($isNewRule) {
            $stub->closeRule();
        }

        return $stub;
    }
public function stub ( string $ name , bool $ isNewRule = true ) : StubVerifier { $ key = strtolower ( $ name ) ; if ( isset ( $ this -> state -> stubs -> $ key ) ) { $ stub = $ this -> state -> stubs -> $ key ; } else { $ stub = $ this -> state -> stubs -> $ key = $ this -> createStub ( $ name ) ; } if ( $ isNewRule ) { $ stub -> closeRule ( ) ; } return $ stub ; }
Get a stub verifier.

@param string $name      The method name.
@param bool   $isNewRule True if a new rule should be started.

@return StubVerifier  The stub verifier.
@throws MockException If the stub does not exist.
Get a stub verifier .