Add apply trait in the scope.

@param string|array $name use trait name(s)
@return void
340855
public function traits($name)
    {
        if (is_array($name)) {
            $this->traits = array_merge($this->traits, $name);
        } else {
            $this->traits[] = $name;
        }
    }
583775
public function addField(string $name, string $value) : void
    {
        $this->fields[$name][] = $value;
    }
844816
protected function addMatched(string $name)
    {
        if (! isset($this->matched[$name])) {
            $this->matched[$name] = $this->newMiddleware($name);
        }
    }
1022288
public function profileEnd($name)
    {
        if (! $this->enable || \is_string($name) === false || empty($name)) {
            return;
        }

        $cid = Coroutine::tid();
        if (! isset($this->profiles[$cid][$name])) {
            $this->profiles[$cid][$name] = [
                'cost'  => 0,
                'total' => 0,
            ];
        }

        $this->profiles[$cid][$name]['cost'] += microtime(true) - $this->profileStacks[$cid][$name]['start'];
        $this->profiles[$cid][$name]['total'] += 1;
    }
281485
public function setName($name)
    {
        if ($this->getMultiValue() === true) {
            $name .= $this->getMultiValueSuffix();
        }

        return parent::setName($name);
    }
342494
public function setAttribute(string $name, $value): void
	{
		Arr::set($this->attributes, $name, $value);
	}
1282737
public function execUp(string $name): void{
        DB::connection('default')->table('migrations')->insert(['name' => $name]);
        $this->up();
    }
507512
public function referenceBegin($name): void
    {
        $this->client->sendBuffer .= $this->client->preparedToSendBuffer;
        $this->client->preparedToSendBuffer = null;
        $signature = sprintf('<H p="1" v="%s">', $name);
        $this->write($signature);
        $signature[6] = '2';
        $this->client->currentArgumentsFormat = $signature;
    }
1344696
public function setName($name)
    {
        if (in_array($name, MathFunctions::asArray())) {
            $this->name = $name;
        } else {
            $msg = "The name attribute must be a value from the MathFunctions enumeration, '" . $name . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1113293
protected function ensureClassOrTraitExists($name, $stmt)
    {
        if (!$this->classExists($name) && !$this->traitExists($name)) {
            throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt);
        }
    }
429281
private function bakeModuleConfig(string $name) : void
    {
        $options = [
            'path' => Configure::read('CsvMigrations.modules.path') . $name . DS . 'config' . DS,
            'ext' => 'json'
        ];

        $this->bake('config.dist', 'Module/config/config', [], '', $options);
        $this->bake('fields.dist', 'Module/config/fields', [], '', $options);
        $this->bake(
            'menus.dist',
            'Module/config/menus',
            ['label' => Inflector::humanize($name), 'url' => DS . Inflector::dasherize($name) . DS],
            '',
            $options
        );
    }
894178
private function addNameAndPattern($name, $pattern)
    {
        $this->arguments[] = $name;
        if ($pattern !== null) {
            $this->arguments[] = $pattern;
        }
    }
950837
public function addExtension(string $name, ?Struct $extension): void
    {
        $this->extensions[$name] = $extension;
    }
467460
public function setNameAttribute(string $name)
    {
        $this->attributes['name'] = $name;
        $this->slug = $slug = str_slug($name);

        if ($this instanceof Model && self::sameSlugs($this, $slug)->exists()) {
            $similarSlugs = self::similarSlugs($this, $slug);
            $postfix = 1;
            $this->slug = $slug.$postfix;
            while ($similarSlugs->has($this->slug)) {
                $postfix++;
                $this->slug = $slug.$postfix;
            }
        }
    }
193680
public function applyChain($name, $hookArg = null)
    {
        $hooks = $this->app->getHooks();

        if (!isset($hooks[$name])) {
            $hooks[$name] = array(array());
        }
        if (!empty($hooks[$name])) {
            // Sort by priority, low to high, if there's more than one priority
            if (count($hooks[$name]) > 1) {
                ksort($hooks[$name]);
            }
            foreach ($hooks[$name] as $priority) {
                if (!empty($priority)) {
                    foreach ($priority as $callable) {
                        $value = call_user_func($callable, $hookArg);
                        if ($value !== null) {
                            return $value;
                        }
                    }
                }
            }
        }
    }
1004273
public function setName($name)
    {
        assert(is_string($name));

        if ($this->_name !== null && $this->_name !== $name) {
            throw new ClientException('Should not update the name of an existing collection');
        }

        $this->_name = (string) $name;
    }
902439
public function addJs($name, $attributes = [])
    {
        if (is_array($name)) {
            $name = $this->combineAssets($name, $this->getLocalPath($this->assetPath));
        }

        $jsPath = $this->getAssetPath($name);

        if (isset($this->controller)) {
            $this->controller->addJs($jsPath, $attributes);
        }

        if (is_string($attributes)) {
            $attributes = ['build' => $attributes];
        }

        $jsPath = $this->getAssetScheme($jsPath);

        if (!in_array($jsPath, $this->assets['js'])) {
            $this->assets['js'][] = ['path' => $jsPath, 'attributes' => $attributes];
        }
    }