Validate the emptiness of a string.

@param mixed $value
@param string $column
@return void
@throws Garp_Model_Validator_Exception
323589
protected function _validateString($value, $column) {
        $value = is_string($value) ? trim($value) : $value;
        if (empty($value) && $value !== '0') {
            throw new Garp_Model_Validator_Exception(
                sprintf(__('%s is a required field'), __(Garp_Util_String::underscoredToReadable($column)))
            );
        }
    }
1199272
protected function validate(&$value)
    {
        $validators = $this->getValidators();

        unset($validators['required']);

        // Do not validate if attribute value is not required and empty value is given
        // 'empty' function is not suitable for this check here
        if (!$this->required && (is_null($value) || $value === '')) {
            return;
        }

        $messages = $this->getValidationMessages();

        foreach ($validators as $validator) {
            $this->applyValidator($validator, $this->attribute, $value, $messages);
        }
    }
793395
protected function addParam($column, $value)
    {
        if (is_array($value)) {
            $this->params = array_merge($this->params, $value);
            $this->param_columns = array_merge($this->param_columns, array_fill(0, count($value), $column));
            return;
        }
        $this->params[] = $value;
        $this->param_columns[] = $column;
    }
63610
public function pull($column, $value = null)
    {
        $this->compileWheres();
        $result = $this->query->update([
            $column => r\row($column)->difference([$value]),
        ])->run();

        return 0 == (int) $result['errors'];
    }
620328
public function setValue($value)
    {
        if (!is_string($value) || (is_object($value) && !method_exists($value, "__toString"))) {
            throw new InvalidArgumentException(sprintf(
                "Invalid argument given to %s, expected a string, %s given",
                __METHOD__,
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        $value = (string) $value;

        if (null !== $regex = $this->getValidationRegex()) {
            if (! preg_match($regex, $value)) {
                throw new InvalidArgumentException(sprintf(
                    "The given value '%s' doesn't match the validation regular expression: %s",
                    $value,
                    $regex
                ));
            }
        }

        $this->value = $value;

        return $this;
    }
204622
public function isValid($value)
    {
        $this->databaseError = null;

        // Empty connection string is valid (defaults to localhost:defaultPort)
        if (!empty($value) && !preg_match($this->pattern, $value)) {
            $this->error(self::INVALID);

            return false;
        }

        return true;
    }
624407
private function setCellValue($column, $value)
    {
        $cellValue = $value;

        if (\is_bool($value)) {
            if ($value) {
                $cellValue = 1;
            } else {
                $cellValue = 0;
            }
        }

        $this->getActiveSheet()->setCellValue($column, $cellValue);
    }
479127
public function setReason($value)
    {
        if ($value === null || $value === '') {
            throw new EmptyPropertyValueException('Empty reason value', 0, 'cancellation_details.reason');
        }
        if (TypeCast::canCastToEnumString($value)) {
            $value = strtolower((string)$value);
            if (CancellationDetailsReasonCode::valueExists($value)) {
                $this->_reason = $value;
            } else {
                throw new InvalidPropertyValueException(
                    'Invalid reason value: "'.$value.'"', 0, 'cancellation_details.reason', $value
                );
            }
        } else {
            throw new InvalidPropertyValueTypeException('Invalid reason value type', 0, 'cancellation_details.reason',
                $value);
        }
    }
924394
public function validate(string $value)
    {
        if (!$value || preg_match($this->pattern, $value)) {
            return;
        }

        $this->error['regex'] = [];
    }
757674
protected function validate($value)
	{
		if ($value < $this->minValue || $value > $this->maxValue)
		{
			throw new InvalidArgumentException('Value ' . $value . ' is out of bounds (' . $this->minValue . '..' . $this->maxValue . ')');
		}
	}
627323
public static function is_blank( $value ) {
		if ( is_null( $value ) ) {
			return true;
		}

		if ( is_string( $value ) ) {
			return trim( $value ) === '';
		}

		if ( $value instanceof \Countable ) {
			return count( $value ) === 0;
		}

		/* @noinspection TypeUnsafeComparisonInspection */
		if ( 0 === $value || '0' === $value ) {
			return false;
		}

		return empty( $value );
	}
206056
private function validate(string $value) : void
    {
        foreach ($this->validators as $validator) {
            if (! $validator->isValid($value)) {
                foreach ($validator->getFailureMessages() as $messageKey => $message) {
                    $this->addTranslatableError($messageKey, $message);
                }
            }
        }
    }
47339
public function validate(Model $model, $value)
    {
        if (!empty($this->choices) && !empty($value)) {
            foreach ($this->choices as $key => $choice) {
                if (is_array($choice)) {
                    foreach ($choice as $inkey => $inchoice) {
                        if ($value === $inchoice) {
                            return;
                        }
                    }
                } else {
                    if ($value === $choice) {
                        return;
                    }
                }
            }

            throw new ValidationError(
                sprintf('Value %s is not a valid choice.', $value),
                'invalid_choice'
            );
        }

        if (is_null($value) && !$this->isNull()) {
            throw new ValidationError('This field cannot be null.', 'null');
        }

        if (empty($value) && !$this->formBlank) {
            throw new ValidationError('This field cannot be blank.', 'blank');
        }
    }
762050
public function isEmpty($value)
    {
        return empty($value) && (is_array($value) || is_object($value) || strlen(trim($value)) === 0);
    }
98240
private static function executeTableShowTableColumn(array $column, $value): void
  {
    $spaces = str_repeat(' ', $column['length'] - mb_strlen((string)$value));

    switch ($column['type'])
    {
      case 1: // tinyint
      case 2: // smallint
      case 3: // int
      case 4: // float
      case 5: // double
      case 8: // bigint
      case 9: // mediumint
      case 246: // decimal
        echo ' ', $spaces.$value, ' ';
        break;

      case 7: // timestamp
      case 10: // date
      case 11: // time
      case 12: // datetime
      case 13: // year
      case 16: // bit
      case 252: // is currently mapped to all text and blob types (MySQL 5.0.51a)
      case 253: // varchar
      case 254: // char
        echo ' ', $value.$spaces, ' ';
        break;

      default:
        throw new FallenException('data type id', $column['type']);
    }
  }
341129
public function validate($str)
    {
        if ($str === null) {
            throw new \InvalidArgumentException('Error: String must not be null');
        }
        if (! is_string($str)) {
            throw new \InvalidArgumentException(
                'Error: String must be of type string but is of type "'.gettype($str).'"'
            );
        }
        if ($str === '') {
            throw new \InvalidArgumentException('Error: String must not be empty');
        }
        if ($this->containsMultibyteChar($str)) {
            throw new \InvalidArgumentException('Error: String must not contain any multibyte characters');
        }
    }
290489
protected function _validate_email($value)
    {
        $value = trim($value);

        return ($value === '' || filter_var($value, FILTER_VALIDATE_EMAIL) !== false) ? strtolower($value) : null;
    }