src/Mock/Builder/MockBuilder.php
public function build(bool $createNew = false): ReflectionClass
    {
        if (!$this->class) {
            $this->class = $this->factory
                ->createMockClass($this->definition(), $createNew);
        }

        return $this->class;
    }
public function build(bool $createNew = false): ReflectionClass
    {
        if (!$this->class) {
            $this->class = $this->factory
                ->createMockClass($this->definition(), $createNew);
        }

        return $this->class;
    }
public function build ( bool $ createNew = false ) : ReflectionClass { if ( ! $ this -> class ) { $ this -> class = $ this -> factory -> createMockClass ( $ this -> definition ( ) , $ createNew ) ; } return $ this -> class ; }
Generate and define the mock class.

Calling this method will finalize the mock builder.

@param bool $createNew True if a new class should be created even when a compatible one exists.

@return ReflectionClass The class.
@throws MockException   If the mock generation fails.
Generate and define the mock class .