當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Assertion::notEmpty方法代碼示例

本文整理匯總了PHP中Assert\Assertion::notEmpty方法的典型用法代碼示例。如果您正苦於以下問題:PHP Assertion::notEmpty方法的具體用法?PHP Assertion::notEmpty怎麽用?PHP Assertion::notEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Assert\Assertion的用法示例。


在下文中一共展示了Assertion::notEmpty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @param SnapshotStore $snapshotStore
  * @param AggregateRepository[] $aggregateRepositories
  */
 public function __construct(SnapshotStore $snapshotStore, array $aggregateRepositories)
 {
     Assertion::notEmpty($aggregateRepositories);
     Assertion::allIsInstanceOf($aggregateRepositories, AggregateRepository::class);
     $this->snapshotStore = $snapshotStore;
     $this->aggregateRepositories = $aggregateRepositories;
 }
開發者ID:prooph,項目名稱:snapshotter,代碼行數:11,代碼來源:Snapshotter.php

示例2: withName

 /**
  * @param string $workflowName
  * @param string $workflowId
  * @return CreateWorkflow
  */
 public static function withName($workflowName, $workflowId)
 {
     Assertion::string($workflowName);
     Assertion::notEmpty($workflowName);
     Assertion::uuid($workflowId);
     return new self(__CLASS__, ['workflow_id' => $workflowId, 'name' => $workflowName]);
 }
開發者ID:prooph,項目名稱:link-process-manager,代碼行數:12,代碼來源:CreateWorkflow.php

示例3: __construct

 public function __construct($templateId, $id)
 {
     Assertion::notEmpty($templateId);
     Assertion::string($id);
     $this->id = $id;
     $this->templateId = $templateId;
 }
開發者ID:mathielen,項目名稱:report-write-engine,代碼行數:7,代碼來源:ReportConfig.php

示例4: __construct

 /**
  * CreateUser constructor.
  *
  * @param string $userName
  * @param string $password
  */
 public function __construct($userName = '', $password = '')
 {
     Assertion::notEmpty($userName, 'Username is a required field to create a user');
     Assertion::notEmpty($password, 'Password is a required field to create a user');
     $this->userName = $userName;
     $this->password = $password;
 }
開發者ID:arnovr,項目名稱:owncloud-provisioning-api-client,代碼行數:13,代碼來源:CreateUser.php

示例5: normalize

 /**
  * @param string $messageName
  * @return string
  */
 public static function normalize($messageName)
 {
     Assertion::notEmpty($messageName);
     Assertion::string($messageName);
     $search = array(static::MESSAGE_NAME_PREFIX, "-", "\\", "/", " ");
     return strtolower(str_replace($search, "", $messageName));
 }
開發者ID:prooph,項目名稱:processing,代碼行數:11,代碼來源:MessageNameUtils.php

示例6: __construct

 /**
  * @param $name
  */
 public function __construct($name)
 {
     Assertion::string($name, 'StreamName must be a string');
     Assertion::notEmpty($name, 'StreamName must not be empty');
     Assertion::maxLength($name, 200, 'StreamName should not be longer than 200 chars');
     $this->name = $name;
 }
開發者ID:prooph,項目名稱:event-store,代碼行數:10,代碼來源:StreamName.php

示例7: _validateIpnListeners

 protected function _validateIpnListeners()
 {
     Assertion::notEmpty($this->ipnListeners);
     foreach ($this->ipnListeners as $ipn_listener) {
         Assertion::isInstanceOf($ipn_listener, PaymentListener::class);
     }
 }
開發者ID:PhillipMwaniki,項目名稱:pesapal-1,代碼行數:7,代碼來源:Config.php

示例8: setToken

 /**
  * Устанавливает описание gitlab'a
  *
  * @param string $token
  *
  * @return $this
  * @throws \Assert\AssertionFailedException
  */
 public function setToken($token)
 {
     Assertion::notEmpty($token);
     Assertion::string($token);
     $this->token = $token;
     return $this;
 }
開發者ID:old-town-gitlab-tools,項目名稱:core,代碼行數:15,代碼來源:OAuth.php

示例9: getProjectConfig

 /**
  * Returns a project config instance.
  *
  * @param string $project Project name
  *
  * @return Config
  */
 public function getProjectConfig($project)
 {
     Assertion::string($project);
     Assertion::notEmpty($project);
     $config = $this->configLoader->load(array($this->getConfigFilePath($project)));
     return $config;
 }
開發者ID:mykanoa,項目名稱:kanoa,代碼行數:14,代碼來源:ConfigHandler.php

示例10: __construct

 /**
  * AddUserToGroup constructor.
  *
  * @param string $userName
  * @param string $groupId
  */
 public function __construct($userName = '', $groupId = '')
 {
     Assertion::notEmpty($userName, 'Username is a required field to add a user to a group');
     Assertion::notEmpty($groupId, 'Group id is a required field to add a user to a group');
     $this->userName = $userName;
     $this->groupId = $groupId;
 }
開發者ID:arnovr,項目名稱:owncloud-provisioning-api-client,代碼行數:13,代碼來源:AddUserToGroup.php

示例11: __construct

 private function __construct(ExpenseListId $id, $name, AccountId $accountId)
 {
     Assertion::notEmpty($name);
     $this->name = $name;
     $this->id = $id;
     $this->accountId = $accountId;
 }
開發者ID:gobudgit,項目名稱:gobudgit,代碼行數:7,代碼來源:ExpenseList.php

示例12: __construct

 /**
  * ActivityTest constructor.
  * @param User      $user
  * @param \DateTime $created
  * @param integer   $activities
  */
 public function __construct(User $user, \DateTime $created, $activities)
 {
     Assertion::integer($activities);
     Assertion::notEmpty($created);
     $this->dateTime = $created;
     $this->activities = $activities;
     $this->user = $user;
 }
開發者ID:arnovr,項目名稱:owncloud-statistics,代碼行數:14,代碼來源:Activity.php

示例13: getField

 public function getField(string $name) : Field
 {
     $fields = array_filter($this->fields, function (Field $field) use($name) : bool {
         return $field->getName() === $name;
     });
     Assertion::notEmpty($fields);
     return reset($fields);
 }
開發者ID:soliantconsulting,項目名稱:simplefm,代碼行數:8,代碼來源:Layout.php

示例14: fromJsonDecodedData

 /**
  * @param array $jsonDecodedData
  * @return Payload
  */
 public static function fromJsonDecodedData(array $jsonDecodedData)
 {
     Assertion::keyExists($jsonDecodedData, 'typeClass');
     Assertion::keyExists($jsonDecodedData, 'data');
     Assertion::notEmpty($jsonDecodedData['typeClass']);
     Assertion::string($jsonDecodedData['typeClass']);
     return new static($jsonDecodedData['typeClass'], $jsonDecodedData['data']);
 }
開發者ID:prooph,項目名稱:processing,代碼行數:12,代碼來源:Payload.php

示例15: consume

 public function consume($queue_name, Closure $message_callback)
 {
     Assertion::string($queue_name);
     Assertion::notEmpty($queue_name);
     $channel = $this->getChannel();
     $channel->basic_qos(null, 1, null);
     $channel->basic_consume($queue_name, false, true, false, false, false, $message_callback);
     return $channel;
 }
開發者ID:honeybee,項目名稱:honeybee,代碼行數:9,代碼來源:JobService.php


注:本文中的Assert\Assertion::notEmpty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。