/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
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)); }
/** * @param string $content * * @throws \InvalidArgumentException */ public function __construct($content) { Assertion::string($content); Assertion::notBlank($content); $this->content = $content; }
public function testValidNotBlank() { Assertion::notBlank("foo"); }
/** * @param string $value */ private function __construct($value) { Guard::notBlank($value, 'Reference can not be empty!'); $this->value = $value; }
private function __construct($title) { Ensure::string($title); Ensure::notBlank($title); $this->title = $title; }
/** * @param string $value */ private function __construct($value) { Guard::notBlank($value, 'SOFORT transaction ID cannot be blank'); $this->value = $value; }
/** * @param string $value */ private function __construct($value) { Guard::notBlank($value, 'iDEAL consumer city cannot be blank'); $this->value = $value; }
/** * 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); }
public static function assertFieldName($fieldName) { Assertion::notBlank($fieldName, 'Field name should not be blank'); }
/** * @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; }
/** * @param string $value */ private function __construct($value) { Guard::notBlank($value, 'Transaction reason cannot be blank'); $this->value = $value; }
/** * @param string $value */ private function __construct($value) { Guard::notBlank($value, 'Merchant order ID cannot be blank'); $this->value = $value; }
public function startTransaction($appName, $license = '') { Assertion::string($appName); Assertion::notBlank($appName); Assertion::string($license); return $this->handle('newrelic_start_transaction', [$appName, $license]); }
/** * @param string $value */ private function __construct($value) { Guard::notBlank($value, 'Description cannot be blank'); $this->value = $value; }
/** * @param string $value */ private function __construct($value) { Guard::notBlank($value, 'Issuer list type cannot be blank'); $this->value = $value; }