Build the class with the given name.

@param  string  $name
@return string
437268
protected function buildClass($name)
    {
        $stub = $this->files->get($this->getStub());

        return $this->replaceClassAndNamespace($name, $stub)->replaceFields($name, $stub);
    }
1128637
protected function getCacheFilename($name)
    {
        $class = substr($this->generateClassName($name), strlen(static::CLASS_PREFIX));

        return str_replace(
            '/',
            DIRECTORY_SEPARATOR,
            sprintf(
                '%s/%s/%s/%s.php',
                $this->getCacheDir(),
                substr($class, 0, 2),
                substr($class, 2, 2),
                substr($class, 4)
            )
        );
    }
1022440
protected function buildClass($name)
	{
		$stub = parent::buildClass($name);

		$stub = str_replace(
			'{{command}}', class_basename($this->option('command')), $stub
		);

		$stub = str_replace(
			'{{fullCommand}}', $this->option('command'), $stub
		);

		return $stub;
	}
663073
public static function getClassNameFromFQN(string $name): string
    {
        $arr = explode('\\', $name);

        return (string)array_pop($arr);
    }
871874
protected function buildClass($name)
    {
        $stub = $this->getFiles()->get($this->getCommandDeclaredStubPath());

        return $this->replaceNamespace($stub, $name)
            ->replaceClassNameSingular($stub, $name)
            ->replaceClassNameLowerCase($stub, $name)
            ->replaceClassName($stub, $name)
            ->replaceModuleFolder($stub, $name)
            ->replaceClass($stub, $name)
            
            ->sanitizeStub($stub, $name);
    }
1055027
private function getClassFor($name)
    {
        $test = strtolower($name);
        foreach ($this->types as $class => $matchers) {
            foreach ($matchers as $matcher) {
                if ($test === $matcher) {
                    return $class;
                }
            }
        }
        return $this->genericType;
    }
273029
public static function getClassFromName(string $name): int
    {
        $class = array_search(strtoupper($name), self::$classes, true);

        if (false === $class || !is_int($class)) {
            throw new \InvalidArgumentException(sprintf('Class: "%s" is not defined.', $name));
        }

        return $class;
    }
1304474
protected function buildClass($name){
        $controllerNamespace = $this->getNamespace($name);
        $replace = [
            'DummyServiceVar' => snake_case($this->replaceServiceVar($name)),
            'DummyModel' => $this->replaceDummyModel($name),
            'DummyContract' => $this->replaceDummyContract($name)
        ];
        return str_replace(
            array_keys($replace), array_values($replace), parent::buildClass($name)
        );
    }
471152
private function getFullClassName($name)
    {
        if ($name instanceof Name) {
            if ($name->isFullyQualified()) {
                return $name->toString();
            }
        }

        $name = (string)$name;

        if (isset($this->namespace->uses[$name])) {
            return $this->namespace->uses[$name];
        }

        if ($this->namespace->name) {
            return $this->namespace->name . '\\' . $name;
        }

        return $name;
    }
1255297
protected function getPropertyClassName($name)
    {
        $name = ucfirst($name);
        if (!$this->php7ClassNames) {
            return $name;
        }

        if (substr($name, -8) == 'Property') {
            return $name;
        }

        return $name.'Property';
    }
646216
public static function build($name, $create = false) 
    {
        self::load();
        $data = self::attributes_for($name);
        if (!$data) {
            return null;
        }

        // if is a different class ...
        if (is_array(self::$_options[$name])
            && array_key_exists("class_name", self::$_options[$name])
        ) {
            $name = self::$_options[$name]["class_name"];
        }

        $cls = ucfirst(strtolower($name));
        $obj = new $cls();
        $pk  = $obj::getPK();

        if (!array_key_exists($pk, $data)) {
            $data[$pk] = null;
        }

        $obj = new $cls($data);  
        if ($create) {
            if (!$obj->isValid()) {
                return null;
            }
            $obj->save();
        }
        return $obj;
    }
1086432
public static function getByName($name)
    {
        $name = (string)$name;
        $class = get_called_class();
        if (isset(self::$instances[$class][$name])) {
            return self::$instances[$class][$name];
        }
        $const = $class . '::' . $name;
        if (!defined($const)) {
            throw new \InvalidArgumentException($const . ' not defined');
        }
        return self::$instances[$class][$name] = new $class(constant($const));
    }
1179150
protected function buildClass($name)
    {
        $class = parent::buildClass($name);

        if ($this->option('markdown')) {
            $class = str_replace('DummyView', $this->option('markdown'), $class);
        }

        return $class;
    }
332195
protected function buildClass($name)
    {
        $replace = [];

        if ($this->option('table')) {
            $replace = $this->replaceTableName($replace);
        } else {
            $replace = $this->removeTableProperty($replace);
        }

        return str_replace(
            array_keys($replace), array_values($replace), parent::buildClass($name)
        );
    }
782705
protected function buildClass($name)
    {
        $stub = $this->files->get($this->getStub());

        $this->replaceNamespace($stub, $name);
        $this->replaceClassName($stub);
        $this->replaceSchema($stub);
        $this->replaceTableName($stub);

        return $stub;
    }
211861
public function build($name = null)
    {
        $caching = new Caching();
        $caching->setStack(new DebugStack());

        if ($this->debug && isset($this->debugDriver)) {
            $caching->setDriver($this->resolveDriver($this->debugDriver));

            return $caching;
        }

        if (null === $name) {
            $name = $this->configuration->get('caching.default', 'null');
        }

        $driver = $this->resolveDriver($name);
        $caching->setDriver($driver);

        return $caching;
    }
1224314
protected function buildClass($name)
    {
        $controllerNamespace = $this->getNamespace($name);

        $replace = [];

        if ($this->option('view')) {
            $replace = $this->buildViewReplacements();
        } else {
            $replace = $this->buildRequestReplacements();
            $replace = $this->buildResourceReplacements($replace);
        }

        $replace = $this->buildModelReplacements($replace);
        $replace = $this->buildRepositoryReplacements($replace);

        $replace["use {$controllerNamespace}\Controller;\n"] = '';

        return str_replace(
            array_keys($replace), array_values($replace), parent::buildClass($name)
        );
    }