当前位置: 首页>>代码示例>>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;未经允许,请勿转载。