WSDL\Builder\IsValid::notEmpty PHP Метод

notEmpty() публичный статический Метод

public static notEmpty ( mixed $value, string | null $customMessage = null ) : void
$value mixed
$customMessage string | null
Результат void
    public static function notEmpty($value, $customMessage = null)
    {
        if (empty($value)) {
            $message = $customMessage ?: 'Value cannot be empty';
            throw new InvalidArgumentException($message);
        }
    }

Usage Example

Пример #1
0
 /**
  * @param string $location
  * @return $this
  * @throws InvalidArgumentException
  */
 public function setLocation($location)
 {
     IsValid::notEmpty($location, 'Location cannot be empty');
     $this->location = $location;
     return $this;
 }
All Usage Examples Of WSDL\Builder\IsValid::notEmpty