當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。