Build the class with the given name.

@param  string $name

@return string
181202
protected function buildClass($name)
    {
        $stub = parent::buildClass($name);

        return $this->replaceType($stub, $name);
    }
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;
    }
590089
public static function getPluginClass(string $name): string
    {
        $class = "";
        if (empty($name) === false && empty(self::$plugin_classes[$name]) === false) {
            $class = self::$plugin_classes[$name];
        }
        return $class;
    }
672933
public function getClassName($name)
    {
        if (!isset($this->mapping[$name])) {
            throw new \InvalidArgumentException(sprintf('Could not find "%s"', $name));
        }

        return $this->mapping[$name];
    }
1089914
protected function buildClass($name)
    {
        $stub = $this->files->get($this->getStub());

        return $this
            ->replaceNamespace($stub, $name)
            ->replaceModel($stub)
            ->replaceAbility($stub)
            ->replaceClass($stub, $name);
    }
457032
public static function getExtensionClass(string $name): string
    {
        $class = "";
        if (empty($name) === false && empty(self::$extension_classes[$name]) === false) {
            $class = self::$extension_classes[$name];
        }
        return $class;
    }
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);
    }
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)
        );
    }
60875
protected function buildClass($name)
    {
        $stub = parent::buildClass($name);

        if ($model = $this->argument('model')) {
            if (!starts_with($model, $namespace = $this->laravel->getNamespace())) {
                $model = "{$namespace}\\{$model}";
            }
        }

        return $this->replaceModel($stub, $model);
    }
1005853
protected function getClassName($name) {
        if (empty($name)) {
            throw new $this->_factoryExceptionClassName ('$name must not be empty');
        }

        $result = $this->getFactoryNamespace() . '\\' . $name . $this->getFactoryPostfix();

        if (!class_exists($result)) {
            throw new $this->_factoryExceptionClassName ('Class "' . $result . '" does not exist');
        }

        return $result;
    }
744891
public function get(string $name)
    {
        $name = $this->getDefinitiveName($name);

        if (!$this->has($name)) {
            $instance = $this->build($name);
            $this->store($instance);
        }

        return $this->instances[$name];
    }
238274
protected function buildClass($name){
        $controllerNamespace = $this->getNamespace($name);

        $replace["use {$controllerNamespace}\Controller;\n"] = '';
        $replace = array_merge($replace, [
            'DummyViewPath' => $this->replaceViewPath($name),
            'DummyServiceVar' => $this->replaceServiceVar($name),
            'DummySingularServiceVar' => $this->replaceSingularServiceVar($name),
            'DummyContract' => $this->replaceDummyContract($name)
        ]);
        //dd($replace);
        return str_replace(
            array_keys($replace), array_values($replace), parent::buildClass($name)
        );
    }
1200988
protected function buildClass($name): string
    {
        $event = $this->option('event');

        if (! starts_with($event, [
            $this->rootNamespace(),
            'Illuminate',
            '\\',
        ])) {
            $event = $this->rootNamespace().'Events\\'.$event;
        }

        $stub = str_replace(
            'DummyEvent', class_basename($event), $this->defaultBuildClass($name)
        );

        return str_replace(
            'DummyFullEvent', $event, $stub
        );
    }
727462
public function getClassName($name)
    {
        $name = $this->replaceDollar($name);
        $name = preg_replace_callback('#[/\{\}]+(\w)#', function ($matches) {
            return ucfirst($matches[1]);
        }, $name);
        $name = Inflector::classify($name);

        if (preg_match(self::BAD_CLASS_NAME_REGEX, $name)) {
            $name = '_'.$name;
        }

        return $name;
    }
635444
protected function buildClass($name)
    {
        $namespaceModel = $this->option('model')
                        ? $this->qualifyClass($this->option('model'))
                        : trim($this->rootNamespace(), '\\').'\\Model';

        $model = class_basename($namespaceModel);

        return str_replace(
            [
                'NamespacedDummyModel',
                'DummyModel',
            ],
            [
                $namespaceModel,
                $model,
            ],
            parent::buildClass($name)
        );
    }
449170
protected function buildClass($name)
    {

        $stub = parent::buildClass($name);

        $this->replaceEndpoint($stub, $this->argument('endpoint'));

        if (! is_null($this->option('esi-version')))
            $this->replaceVersion($stub, $this->option('esi-version'));

        if (! is_null($this->option('scope')))
            $this->replaceScope($stub, $this->option('scope'));

        return $stub;
    }
1163764
protected function buildClass($name)
    {
        $stub = $this->replaceUserNamespace(
            parent::buildClass($name)
        );

        $model = $this->option('model');

        return $model ? $this->replaceModel($stub, $model) : $stub;
    }