src/Mock/Builder/MockBuilder.php
public function named(string $className): self
    {
        if ($this->isFinalized) {
            throw new FinalizedMockException();
        }

        if ('' !== $className) {
            if (
                !preg_match('/^' . static::SYMBOL_PATTERN . '$/S', $className)
            ) {
                throw new InvalidClassNameException($className);
            }
        }

        $this->className = $className;

        return $this;
    }
public function named(string $className): self
    {
        if ($this->isFinalized) {
            throw new FinalizedMockException();
        }

        if ('' !== $className) {
            if (
                !preg_match('/^' . static::SYMBOL_PATTERN . '$/S', $className)
            ) {
                throw new InvalidClassNameException($className);
            }
        }

        $this->className = $className;

        return $this;
    }
public function named ( string $ className ) : self { if ( $ this -> isFinalized ) { throw new FinalizedMockException ( ) ; } if ( '' !== $ className ) { if ( ! preg_match ( '/^' . static :: SYMBOL_PATTERN . '$/S' , $ className ) ) { throw new InvalidClassNameException ( $ className ) ; } } $ this -> className = $ className ; return $ this ; }
Set the class name.

@param string $className The class name, or empty string to use a generated name.

@return $this         This builder.
@throws MockException If this builder is already finalized.
Set the class name .