当前位置: 首页>>代码示例>>PHP>>正文


PHP Assertion::notBlank方法代码示例

本文整理汇总了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;
 }
开发者ID:comphppuebla,项目名称:easy-forms,代码行数:10,代码来源:Element.php

示例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;
 }
开发者ID:jeroenvdgulik,项目名称:lonelypullrequests.com,代码行数:7,代码来源:RepositoryName.php

示例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;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:15,代码来源:Uploader.php

示例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;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:15,代码来源:News.php

示例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;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:15,代码来源:GalleryLocation.php

示例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;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:15,代码来源:Publication.php

示例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));
 }
开发者ID:honeybee,项目名称:honeybee,代码行数:21,代码来源:ElasticsearchFinder.php

示例8: __construct

 /**
  * @param string $content
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($content)
 {
     Assertion::string($content);
     Assertion::notBlank($content);
     $this->content = $content;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:11,代码来源:Tag.php

示例9: testValidNotBlank

 public function testValidNotBlank()
 {
     Assertion::notBlank("foo");
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:4,代码来源:AssertTest.php

示例10: __construct

 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::notBlank($value, 'Reference can not be empty!');
     $this->value = $value;
 }
开发者ID:gingerpayments,项目名称:ginger-php,代码行数:8,代码来源:Reference.php

示例11: __construct

 private function __construct($title)
 {
     Ensure::string($title);
     Ensure::notBlank($title);
     $this->title = $title;
 }
开发者ID:jeroenvdgulik,项目名称:lonelypullrequests.com,代码行数:6,代码来源:Title.php

示例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);
 }
开发者ID:netzmacht,项目名称:workflow,代码行数:14,代码来源:Permission.php

示例13: assertFieldName

 public static function assertFieldName($fieldName)
 {
     Assertion::notBlank($fieldName, 'Field name should not be blank');
 }
开发者ID:wookieb,项目名称:query-object,代码行数:4,代码来源:ConditionsUtil.php

示例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;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:15,代码来源:Image.php

示例15: startTransaction

 public function startTransaction($appName, $license = '')
 {
     Assertion::string($appName);
     Assertion::notBlank($appName);
     Assertion::string($license);
     return $this->handle('newrelic_start_transaction', [$appName, $license]);
 }
开发者ID:refinery29,项目名称:newrelic,代码行数:7,代码来源:Agent.php


注:本文中的Assert\Assertion::notBlank方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。