@param string $name

@return void

@throws ValidationException
424780
protected function setName($name)
    {
        if (false === is_string($name)) {
            $type = gettype($name);
            throw new ValidationException("Term 'name' must be of type string. Type $type received.");
        }

        $this->name = $name;
    }
1003790
private function bakeEntity(string $name) : void
    {
        $this->pathFragment = 'Model/Entity/';

        $this->bake($this->_entityName($name), 'Model/entity', ['name' => $this->_entityName($name)]);
    }
492797
public function assertValid(array $attributes)
    {
        $validator = $this->makeValidator($attributes);

        if ($validator->fails()) {
            throw new ValidationException($validator);
        }
    }
1019739
public function validateEmailSenderName($name)
    {
        if (mb_strlen($name, 'UTF-8') > 255) {
            $this->addError(EmailConfigurationTransformer::EMAIL_SENDER_NAME, 'Sender name length has to be less or equal to 255');
            return false;
        }

        return true;
    }
844146
private function validate($name)
    {
        if (!is_string($name)) {
            throw new InvalidNameException('Migration name must be a string, got ' . gettype($name));
        }

        if (strlen($name) === 0) {
            throw new InvalidNameException('Migration name must not be empty');
        }

        $validCharsRegex = '/^[' . self::NAME_VALID_CHARS_REGEX . ']+$/';
        if (preg_match($validCharsRegex, $name) === 0) {
            $invalidChars = preg_replace('/[' . self::NAME_VALID_CHARS_REGEX . ']/', '', $name);
            throw new InvalidNameException('Migration name contains invalid characters: ' . $invalidChars);
        }

        if (strlen($name) > self::MAX_NAME_LENGTH) {
            throw new InvalidNameException(sprintf(
                'Migration name cannot exceed %d characters, is %d: %s',
                self::MAX_NAME_LENGTH,
                strlen($name),
                $name
            ));
        }
    }
829949
private function checkName(&$name)
    {
        if (! is_string($name)) {
            throw new InvalidTypeException(
                'The name must be a string value, ' . gettype($name) . ' is given.'
            );
        }

        $name = strtolower(trim($name));

        if (empty($name)) {
            throw new Exception('The attribute name must not be empty.');
        }
    }
763150
protected function validate(array $data, array $rules = null): void
    {
        $validator = $this->validatorFactory->make($data, $rules ?? $this->getValidationRules());
        if ($validator->fails()) {
            throw new ValidationException($validator);
        }
    }
769655
public function setSenderName($name)
    {
        if (!$this->validateHeaderFieldValue($name)) {
            throw new EmailValidationException(__('Sender Name can not contain carriage return or newlines.'));
        }

        $this->_sender_name = $name;
    }
1128271
public function addCalculator(string $name, string $validation): void{
        $this->calculators[$name] = $validation;
    }
1220378
protected function validateFileName($fileName = null)
    {
        if ($fileName === null) {
            $fileName = $this->fileName;
        }

        $fileName = trim($fileName);

        if (!strlen($fileName)) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.file_name_required', [
                    'allowed' => implode(', ', $this->allowedExtensions),
                    'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                ])
            ]);
        }

        if (!FileHelper::validateExtension($fileName, $this->allowedExtensions, false)) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.invalid_file_extension', [
                    'allowed' => implode(', ', $this->allowedExtensions),
                    'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                ])
            ]);
        }

        if (!FileHelper::validatePath($fileName, null)) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.invalid_file', [
                    'name' => $fileName
                ])
            ]);
        }
    }
566363
static public function validateName($name)
    {
        if (null !== $name && !is_string($name)) {
            throw new Exception\UnexpectedTypeException($name, 'string, integer or null');
        }

        if (!preg_match('/^[a-zA-Z0-9_]+$/', $name)) {
            throw new Exception\InvalidArgumentException(sprintf(
                'The name "%s" contains illegal characters. Names should only contain letters, numbers and underscores.',
                $name
            ));
        }
    }
899138
protected function validateName($name)
    {
        if (!ApiKey::isValidName($name)) {
            return self::MESSAGE_ERROR_INVALID_NAME_FORMAT;
        }
        if (ApiKey::nameExists($name)) {
            return self::MESSAGE_ERROR_NAME_ALREADY_USED;
        }
        return null;
    }
321673
public function validate() {

		if ($this->getCurrency() === null) {
			throw new ValidationException("'currency' can't be null", 'currency', $this);
		}
		if ($this->getProduct() === null) {
			throw new ValidationException("'product' can't be null", 'product', $this);
		}
		if ($this->getSubscription() === null) {
			throw new ValidationException("'subscription' can't be null", 'subscription', $this);
		}
	}
142781
public function buildValidator(Event $event, Validator $validator, string $name): void
    {
        $this->validationStrictPassword($validator);
    }
1234606
public function delete(string $name): void
    {
        !$this->all && $this->inputs();

        Arrays::delete($this->input, $name);
        $this->cache = [];
    }
1324794
public function dropColumn($name)
    {
        if (!$this->hasColumn($name)) {
            throw SchemaException::tableColumnDoesNotExist($this->getName(), $name);
        }

        unset($this->columns[$name]);
    }
357568
public function clickListElement(string $name): void
    {
        $this->context->getElementByText($name, $this->fields['listElement'])->click();
    }