notBlank() public static method

Assert that value is not blank
public static notBlank ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
return boolean
Exemplo n.º 1
0
 /**
  * @param string $name
  */
 protected function setName($name)
 {
     Assertion::string($name);
     Assertion::notBlank($name);
     $this->attributes['name'] = $name;
     $this->name = $name;
 }
 private function __construct($repositoryName)
 {
     Ensure::string($repositoryName);
     Ensure::notBlank($repositoryName);
     Ensure::regex($repositoryName, '/^[a-zA-Z0-9\\-]+\\/[a-zA-Z0-9\\-\\.]+$/');
     $this->repositoryName = $repositoryName;
 }
Exemplo n.º 3
0
 /**
  * @param string $info
  *
  * @throws \InvalidArgumentException
  *
  * @return static
  */
 public function withInfo($info)
 {
     Assertion::string($info);
     Assertion::notBlank($info);
     $instance = clone $this;
     $instance->info = $info;
     return $instance;
 }
Exemplo n.º 4
0
 /**
  * @param PublicationInterface $publication
  * @param \DateTimeInterface   $publicationDate
  * @param string               $title
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(PublicationInterface $publication, \DateTimeInterface $publicationDate, $title)
 {
     Assertion::string($title);
     Assertion::notBlank($title);
     $this->publication = $publication;
     $this->publicationDate = $publicationDate;
     $this->title = $title;
 }
Exemplo n.º 5
0
 /**
  * @param string $title
  *
  * @throws \InvalidArgumentException
  *
  * @return static
  */
 public function withTitle($title)
 {
     Assertion::string($title);
     Assertion::notBlank($title);
     $instance = clone $this;
     $instance->title = $title;
     return $instance;
 }
Exemplo n.º 6
0
 /**
  * @param string $name
  * @param string $language
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($name, $language)
 {
     Assertion::string($name);
     Assertion::notBlank($name);
     Assertion::string($language);
     Assertion::notBlank($language);
     $this->name = $name;
     $this->language = $language;
 }
Exemplo n.º 7
0
 public function getByIdentifier($identifier)
 {
     Assertion::string($identifier);
     Assertion::notBlank($identifier);
     $index = $this->getIndex();
     if (empty($index) || $index == '_all' || is_array($index) && count($index) > 1 || is_string($index) && strpos($index, ',') !== false) {
         throw new RuntimeError(sprintf('Elasticsearch single index APIs do not support multiple indices: %s', var_export($index, true)));
     }
     $data = ['index' => $index, 'type' => $this->getType(), 'id' => $identifier];
     $query = array_merge($data, $this->getParameters('get'));
     if ($this->config->get('log_get_query', false) === true) {
         $this->logger->debug('[' . __METHOD__ . '] get query = ' . json_encode($query, JSON_PRETTY_PRINT));
     }
     try {
         $raw_result = $this->connector->getConnection()->get($query);
         $mapped_results = $this->mapResultData($raw_result);
     } catch (Missing404Exception $error) {
         $mapped_results = [];
     }
     return new FinderResult($mapped_results, count($mapped_results));
 }
Exemplo n.º 8
0
 /**
  * @param string $content
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($content)
 {
     Assertion::string($content);
     Assertion::notBlank($content);
     $this->content = $content;
 }
Exemplo n.º 9
0
 public function testValidNotBlank()
 {
     Assertion::notBlank("foo");
 }
Exemplo n.º 10
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'Reference can not be empty!');
     $this->value = $value;
 }
Exemplo n.º 11
0
 private function __construct($title)
 {
     Ensure::string($title);
     Ensure::notBlank($title);
     $this->title = $title;
 }
Exemplo n.º 12
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'SOFORT transaction ID cannot be blank');
     $this->value = $value;
 }
Exemplo n.º 13
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'iDEAL consumer city cannot be blank');
     $this->value = $value;
 }
Exemplo n.º 14
0
 /**
  * Guard that permissoin values are valid.
  *
  * @param string      $workflowName The workflow name.
  * @param string      $permissionId The permission id.
  * @param string|null $message      Optional error message.
  *
  * @return void
  */
 protected static function guardValidPermission($workflowName, $permissionId, $message = null)
 {
     Assertion::notBlank($workflowName, $message);
     Assertion::notBlank($permissionId, $message);
 }
Exemplo n.º 15
0
 public static function assertFieldName($fieldName)
 {
     Assertion::notBlank($fieldName, 'Field name should not be blank');
 }
Exemplo n.º 16
0
 /**
  * @param string $licence
  *
  * @throws \InvalidArgumentException
  *
  * @return static
  */
 public function withLicence($licence)
 {
     Assertion::string($licence);
     Assertion::notBlank($licence);
     $instance = clone $this;
     $instance->licence = $licence;
     return $instance;
 }
Exemplo n.º 17
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'Transaction reason cannot be blank');
     $this->value = $value;
 }
Exemplo n.º 18
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'Merchant order ID cannot be blank');
     $this->value = $value;
 }
Exemplo n.º 19
0
 public function startTransaction($appName, $license = '')
 {
     Assertion::string($appName);
     Assertion::notBlank($appName);
     Assertion::string($license);
     return $this->handle('newrelic_start_transaction', [$appName, $license]);
 }
Exemplo n.º 20
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'Description cannot be blank');
     $this->value = $value;
 }
Exemplo n.º 21
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'Issuer list type cannot be blank');
     $this->value = $value;
 }