本文整理汇总了PHP中Assert\Assertion::notBlank方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::notBlank方法的具体用法?PHP Assertion::notBlank怎么用?PHP Assertion::notBlank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assert\Assertion
的用法示例。
在下文中一共展示了Assertion::notBlank方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setName
/**
* @param string $name
*/
protected function setName($name)
{
Assertion::string($name);
Assertion::notBlank($name);
$this->attributes['name'] = $name;
$this->name = $name;
}
示例2: __construct
private function __construct($repositoryName)
{
Ensure::string($repositoryName);
Ensure::notBlank($repositoryName);
Ensure::regex($repositoryName, '/^[a-zA-Z0-9\\-]+\\/[a-zA-Z0-9\\-\\.]+$/');
$this->repositoryName = $repositoryName;
}
示例3: withInfo
/**
* @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;
}
示例4: __construct
/**
* @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;
}
示例5: withTitle
/**
* @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;
}
示例6: __construct
/**
* @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;
}
示例7: getByIdentifier
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));
}
示例8: __construct
/**
* @param string $content
*
* @throws \InvalidArgumentException
*/
public function __construct($content)
{
Assertion::string($content);
Assertion::notBlank($content);
$this->content = $content;
}
示例9: testValidNotBlank
public function testValidNotBlank()
{
Assertion::notBlank("foo");
}
示例10: __construct
/**
* @param string $value
*/
private function __construct($value)
{
Guard::notBlank($value, 'Reference can not be empty!');
$this->value = $value;
}
示例11: __construct
private function __construct($title)
{
Ensure::string($title);
Ensure::notBlank($title);
$this->title = $title;
}
示例12: guardValidPermission
/**
* 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);
}
示例13: assertFieldName
public static function assertFieldName($fieldName)
{
Assertion::notBlank($fieldName, 'Field name should not be blank');
}
示例14: withLicence
/**
* @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;
}
示例15: startTransaction
public function startTransaction($appName, $license = '')
{
Assertion::string($appName);
Assertion::notBlank($appName);
Assertion::string($license);
return $this->handle('newrelic_start_transaction', [$appName, $license]);
}