src/Stub/StubVerifierFactory.php
public function create(Stub $stub = null, $self = null): StubVerifier
    {
        if (!$stub) {
            $stub = $this->stubFactory->create();
        }

        $verifier = new StubVerifier(
            $stub,
            $this->spyFactory->create($stub),
            $this->matcherFactory,
            $this->matcherVerifier,
            $this->generatorVerifierFactory,
            $this->iterableVerifierFactory,
            $this->callVerifierFactory,
            $this->assertionRecorder,
            $this->assertionRenderer,
            $this->generatorAnswerBuilderFactory
        );

        if (func_num_args() > 1) {
            $verifier->setSelf($self);
        } else {
            $verifier->setSelf($verifier);
        }

        return $verifier;
    }
public function create(Stub $stub = null, $self = null): StubVerifier
    {
        if (!$stub) {
            $stub = $this->stubFactory->create();
        }

        $verifier = new StubVerifier(
            $stub,
            $this->spyFactory->create($stub),
            $this->matcherFactory,
            $this->matcherVerifier,
            $this->generatorVerifierFactory,
            $this->iterableVerifierFactory,
            $this->callVerifierFactory,
            $this->assertionRecorder,
            $this->assertionRenderer,
            $this->generatorAnswerBuilderFactory
        );

        if (func_num_args() > 1) {
            $verifier->setSelf($self);
        } else {
            $verifier->setSelf($verifier);
        }

        return $verifier;
    }
public function create ( Stub $ stub = null , $ self = null ) : StubVerifier { if ( ! $ stub ) { $ stub = $ this -> stubFactory -> create ( ) ; } $ verifier = new StubVerifier ( $ stub , $ this -> spyFactory -> create ( $ stub ) , $ this -> matcherFactory , $ this -> matcherVerifier , $ this -> generatorVerifierFactory , $ this -> iterableVerifierFactory , $ this -> callVerifierFactory , $ this -> assertionRecorder , $ this -> assertionRenderer , $ this -> generatorAnswerBuilderFactory ) ; if ( func_num_args ( ) > 1 ) { $ verifier -> setSelf ( $ self ) ; } else { $ verifier -> setSelf ( $ verifier ) ; } return $ verifier ; }
Create a new stub verifier.

If the "self" value is omitted, it will be set to the verifier itself.

@param Stub|null $stub The stub, or null to create an anonymous stub.
@param mixed     $self The "self" value.

@return StubVerifier The newly created stub verifier.
Create a new stub verifier .