本文整理汇总了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;
}
示例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]);
}
示例3: __construct
public function __construct($templateId, $id)
{
Assertion::notEmpty($templateId);
Assertion::string($id);
$this->id = $id;
$this->templateId = $templateId;
}
示例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;
}
示例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));
}
示例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;
}
示例7: _validateIpnListeners
protected function _validateIpnListeners()
{
Assertion::notEmpty($this->ipnListeners);
foreach ($this->ipnListeners as $ipn_listener) {
Assertion::isInstanceOf($ipn_listener, PaymentListener::class);
}
}
示例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;
}
示例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;
}
示例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;
}
示例11: __construct
private function __construct(ExpenseListId $id, $name, AccountId $accountId)
{
Assertion::notEmpty($name);
$this->name = $name;
$this->id = $id;
$this->accountId = $accountId;
}
示例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;
}
示例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);
}
示例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']);
}
示例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;
}