src/Mock/Builder/MockBuilder.php
public function source(MockGenerator $generator = null): string
    {
        if (!$generator) {
            $generator = MockGenerator::instance();
        }

        return $generator->generate($this->definition());
    }
public function source(MockGenerator $generator = null): string
    {
        if (!$generator) {
            $generator = MockGenerator::instance();
        }

        return $generator->generate($this->definition());
    }
public function source ( MockGenerator $ generator = null ) : string { if ( ! $ generator ) { $ generator = MockGenerator :: instance ( ) ; } return $ generator -> generate ( $ this -> definition ( ) ) ; }
Get the generated source code of the mock class.

Calling this method will finalize the mock builder.

@param MockGenerator|null $generator The mock generator to use.

@return string        The source code.
@throws MockException If the mock generation fails.
Get the generated source code of the mock class .