本文整理汇总了PHP中Assert\Assertion::uuid方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::uuid方法的具体用法?PHP Assertion::uuid怎么用?PHP Assertion::uuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assert\Assertion
的用法示例。
在下文中一共展示了Assertion::uuid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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]);
}
示例2: withData
public static function withData($workflowId, $previousTaskId, $nextMessageHandlerId)
{
Assertion::uuid($workflowId);
Assertion::uuid($previousTaskId);
Assertion::uuid($nextMessageHandlerId);
return new self(__CLASS__, ['workflow_id' => $workflowId, 'previous_task_id' => $previousTaskId, 'next_message_handler_id' => $nextMessageHandlerId]);
}
示例3: fromString
public static function fromString($uuid)
{
Assertion::uuid($uuid);
$patientId = new static();
$patientId->id = $uuid;
return $patientId;
}
示例4: getLoggedProcess
/**
* @param string $processId
* @return null|array process log, see {@method getLastLoggedProcesses} for structure
*/
public function getLoggedProcess($processId)
{
Assertion::uuid($processId);
$query = $this->connection->createQueryBuilder();
$query->select('*')->from(Tables::PROCESS_LOG)->where('process_id = :process_id')->setParameter('process_id', $processId);
return $query->execute()->fetch();
}
示例5: guard
/**
* @param mixed $value
*
* @throws InvalidUuidException
*/
protected function guard($value)
{
try {
Assertion::uuid($value);
} catch (\Exception $e) {
throw new InvalidUuidException($value);
}
}
示例6: __construct
/**
* Creates a new identifier with the given UUID.
*
* @param Uuid|string $uuid
*/
private function __construct($uuid)
{
if ($uuid instanceof Uuid) {
$uuid = $uuid->toString();
}
Assertion::uuid($uuid);
$this->uuid = (string) $uuid;
}
示例7: gameStart
/**
* @param string $gameId
* @param string $word
* @return Game
*/
public static function gameStart($gameId, $word)
{
Assertion::uuid($gameId, "Not a valid uuid");
$game = new Game();
$dateTime = new \DateTime("now");
$game->apply(new GameStarted($gameId, $word, $dateTime));
return $game;
}
示例8: __construct
public function __construct($value = null)
{
if (!$value) {
$value = BaseUuid::uuid4();
}
Assertion::uuid((string) $value);
$this->value = (string) $value;
}
示例9: setUuidAttribute
public function setUuidAttribute($value)
{
if ($value instanceof UuidIdentifier) {
$value = $value->toString();
}
Assertion::uuid($value, 'Invalid format for UUID');
$this->attributes['uuid'] = $value;
}
示例10: __construct
/**
* @param UuidInterface $id
* @param int $amount
* @param Product $product
*/
public function __construct(UuidInterface $id, $amount, Product $product)
{
Assertion::uuid($id->toString());
Assertion::integer($amount);
Assertion::notEmpty($product);
$this->id = $id;
$this->amount = $amount;
$this->product = $product;
}
示例11: guardRequiredState
protected function guardRequiredState()
{
parent::guardRequiredState();
Assertion::string($this->parent_attribute_name);
Assertion::string($this->embedded_entity_type);
Assertion::uuid($this->embedded_entity_identifier);
Assertion::isArray($this->embedded_entity_events);
Assertion::isArray($this->data);
}
示例12: __construct
/**
* GitLab constructor.
*
* @param $id
* @param $name
* @param $url
* @param array $authData
* @param GitLab\AuthInterface $auth
*
* @throws \Assert\AssertionFailedException
*/
public function __construct($id, $name, $url, array $authData, GitLab\AuthInterface $auth)
{
Assertion::uuid($id);
$this->id = $id;
$this->setAuthData(new ArrayCollection($authData));
$this->setName($name);
$this->setUrl($url);
$this->setAuth($auth);
}
示例13: removeProductFromBasketAction
/**
* @param string $basketId
*
* @return Response
*/
public function removeProductFromBasketAction(Request $request, $basketId)
{
$basketId = new BasketId($basketId);
$productToRemove = $request->request->get('productId');
Assert::uuid($productToRemove);
$command = new RemoveProductFromBasket($basketId, $productToRemove);
$this->commandBus->dispatch($command);
return new Response();
}
示例14: withData
/**
* @param string $workflowId
* @param array $startMessage
* @param string $firstMessageHandlerId
* @return ScheduleFirstTasksForWorkflow
*/
public static function withData($workflowId, $startMessage, $firstMessageHandlerId)
{
Assertion::uuid($workflowId);
Assertion::uuid($firstMessageHandlerId);
Assertion::isArray($startMessage);
Assertion::keyExists($startMessage, 'message_type');
Assertion::keyExists($startMessage, 'processing_type');
$processingType = $startMessage['processing_type'];
Assertion::implementsInterface($processingType, Type::class);
return new self(__CLASS__, ['workflow_id' => $workflowId, 'start_message' => $startMessage, 'first_message_handler' => $firstMessageHandlerId]);
}
示例15: __construct
/**
* BaseReport constructor.
*
* @param BaseReportBuilder $builder
*
* @throws \Assert\AssertionFailedException
*/
public function __construct(BaseReportBuilder $builder)
{
$id = $builder->getId();
Assertion::uuid($id);
$this->id = $id;
$name = $builder->getName();
Assertion::string($name);
Assertion::notEmpty($name);
$this->name = $name;
$description = $builder->getDescription();
Assertion::nullOrString($description);
$this->setDescription($description);
$gitLab = $builder->getGitLab();
Assertion::isInstanceOf($gitLab, GitLab::class);
$this->gitLab = $gitLab;
}