public static function notEmpty($value, $customMessage = null) { if (empty($value)) { $message = $customMessage ?: 'Value cannot be empty'; throw new InvalidArgumentException($message); } }
/** * @param string $location * @return $this * @throws InvalidArgumentException */ public function setLocation($location) { IsValid::notEmpty($location, 'Location cannot be empty'); $this->location = $location; return $this; }