当前位置: 首页>>代码示例>>PHP>>正文


PHP Assertion::uuid方法代码示例

本文整理汇总了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]);
 }
开发者ID:prooph,项目名称:link-process-manager,代码行数:12,代码来源:CreateWorkflow.php

示例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]);
 }
开发者ID:prooph,项目名称:link-process-manager,代码行数:7,代码来源:ScheduleNextTasksForWorkflow.php

示例3: fromString

 public static function fromString($uuid)
 {
     Assertion::uuid($uuid);
     $patientId = new static();
     $patientId->id = $uuid;
     return $patientId;
 }
开发者ID:arnovr,项目名称:workshop_noback,代码行数:7,代码来源:PatientId.php

示例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();
 }
开发者ID:prooph,项目名称:link-process-manager,代码行数:11,代码来源:ProcessLogFinder.php

示例5: guard

 /**
  * @param mixed $value
  *
  * @throws InvalidUuidException
  */
 protected function guard($value)
 {
     try {
         Assertion::uuid($value);
     } catch (\Exception $e) {
         throw new InvalidUuidException($value);
     }
 }
开发者ID:bruli,项目名称:php-value-objects,代码行数:13,代码来源:Uuid.php

示例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;
 }
开发者ID:phpinpractice,项目名称:event-store,代码行数:13,代码来源:IsUuidIdentifier.php

示例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;
 }
开发者ID:lenmen,项目名称:hangman_leon,代码行数:13,代码来源:Game.php

示例8: __construct

 public function __construct($value = null)
 {
     if (!$value) {
         $value = BaseUuid::uuid4();
     }
     Assertion::uuid((string) $value);
     $this->value = (string) $value;
 }
开发者ID:xtreamwayz,项目名称:zend-expressive-app-poc,代码行数:8,代码来源:Uuid.php

示例9: setUuidAttribute

 public function setUuidAttribute($value)
 {
     if ($value instanceof UuidIdentifier) {
         $value = $value->toString();
     }
     Assertion::uuid($value, 'Invalid format for UUID');
     $this->attributes['uuid'] = $value;
 }
开发者ID:marklj,项目名称:eloquent-uuid,代码行数:8,代码来源:UuidModel.php

示例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;
 }
开发者ID:palya-framework,项目名称:palya,代码行数:14,代码来源:CartEntry.php

示例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);
 }
开发者ID:honeybee,项目名称:honeybee,代码行数:9,代码来源:EmbeddedEntityEvent.php

示例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);
 }
开发者ID:old-town-gitlab-tools,项目名称:core,代码行数:20,代码来源:GitLab.php

示例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();
 }
开发者ID:loicbourg,项目名称:broadway-demo,代码行数:14,代码来源:BasketController.php

示例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]);
 }
开发者ID:prooph,项目名称:link-process-manager,代码行数:17,代码来源:ScheduleFirstTasksForWorkflow.php

示例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;
 }
开发者ID:old-town-gitlab-tools,项目名称:core,代码行数:23,代码来源:BaseReport.php


注:本文中的Assert\Assertion::uuid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。