當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。