當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Assertion::allIsInstanceOf方法代碼示例

本文整理匯總了PHP中Assert\Assertion::allIsInstanceOf方法的典型用法代碼示例。如果您正苦於以下問題:PHP Assertion::allIsInstanceOf方法的具體用法?PHP Assertion::allIsInstanceOf怎麽用?PHP Assertion::allIsInstanceOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Assert\Assertion的用法示例。


在下文中一共展示了Assertion::allIsInstanceOf方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @param Field[] $elements
  * @param Ship[] $ships
  */
 private function __construct(array $elements, array $ships = [])
 {
     Assertion::allIsInstanceOf($elements, Field::class);
     Assertion::allIsInstanceOf($ships, Ship::class);
     $this->elements = $elements;
     $this->ships = $ships;
 }
開發者ID:WeCamp,項目名稱:flyingliquourice,代碼行數:11,代碼來源:Fields.php

示例2: __construct

 /**
  * @param databox_field[] $fields
  */
 public function __construct($fields = [])
 {
     Assertion::allIsInstanceOf($fields, databox_field::class);
     foreach ($fields as $field) {
         $this->add_element($field);
     }
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:10,代碼來源:descriptionStructure.php

示例3: filterByValueCompatibility

 public static function filterByValueCompatibility(array $list, $value)
 {
     Assertion::allIsInstanceOf($list, Typed::class);
     $is_numeric = is_numeric($value);
     $is_valid_date = RecordHelper::validateDate($value);
     $filtered = [];
     foreach ($list as $item) {
         switch ($item->getType()) {
             case Mapping::TYPE_FLOAT:
             case Mapping::TYPE_DOUBLE:
             case Mapping::TYPE_INTEGER:
             case Mapping::TYPE_LONG:
             case Mapping::TYPE_SHORT:
             case Mapping::TYPE_BYTE:
                 if ($is_numeric) {
                     $filtered[] = $item;
                 }
                 break;
             case Mapping::TYPE_DATE:
                 if ($is_valid_date) {
                     $filtered[] = $item;
                 }
                 break;
             case Mapping::TYPE_STRING:
             default:
                 $filtered[] = $item;
         }
     }
     return $filtered;
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:30,代碼來源:ValueChecker.php

示例4: __construct

 /**
  * Construct.
  *
  * @param TransitionHandlerFactory $handlerFactory  The transition handler factory.
  * @param StateRepository          $stateRepository The state repository.
  * @param Workflow[]               $workflows       The set of managed workflows.
  */
 public function __construct(TransitionHandlerFactory $handlerFactory, StateRepository $stateRepository, $workflows = array())
 {
     Assertion::allIsInstanceOf($workflows, 'Netzmacht\\Workflow\\Flow\\Workflow');
     $this->workflows = $workflows;
     $this->handlerFactory = $handlerFactory;
     $this->stateRepository = $stateRepository;
 }
開發者ID:netzmacht,項目名稱:workflow,代碼行數:14,代碼來源:WorkflowManager.php

示例5: __construct

 /**
  * @param array $processingTypes
  * @param bool $supportAll
  */
 private function __construct(array $processingTypes, $supportAll)
 {
     Assertion::allIsInstanceOf($processingTypes, Prototype::class);
     Assertion::boolean($supportAll);
     $this->supportedProcessingTypes = $processingTypes;
     $this->supportAllTypes = $supportAll;
 }
開發者ID:prooph,項目名稱:link-process-manager,代碼行數:11,代碼來源:ProcessingTypes.php

示例6: __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

示例7: __construct

 /** @param Processor[] $processors */
 public function __construct(HttpClient $httpClient, array $processors)
 {
     Assertion::allIsInstanceOf($processors, Processor::class);
     $this->httpClient = $httpClient;
     foreach ($processors as $processor) {
         $this->processors[$processor->getContentType()] = $processor;
     }
 }
開發者ID:tomphp,項目名稱:hal-client,代碼行數:9,代碼來源:Client.php

示例8: __construct

 /**
  * @param TechnicalData[] $data
  */
 public function __construct($data = [])
 {
     Assertion::allIsInstanceOf($data, TechnicalData::class);
     $this->data = [];
     foreach ($data as $technicalData) {
         $this->data[$technicalData->getName()] = $technicalData;
     }
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:11,代碼來源:ArrayTechnicalDataSet.php

示例9: addConditions

 /**
  * Add multiple conditions.
  *
  * @param array $conditions Array of conditions being added.
  *
  * @return $this
  *
  * @throws \Assert\InvalidArgumentException If array contains an invalid condition.
  */
 public function addConditions(array $conditions)
 {
     Assertion::allIsInstanceOf($conditions, 'Netzmacht\\Workflow\\Flow\\Condition\\Transition\\Condition');
     foreach ($conditions as $condition) {
         $this->addCondition($condition);
     }
     return $this;
 }
開發者ID:netzmacht,項目名稱:workflow,代碼行數:17,代碼來源:ConditionCollection.php

示例10: __construct

 /**
  * @param string        $aType
  * @param array         $aProcessStepCollection
  * @param AgentOptions  $anOptions
  */
 public function __construct($aType, array $aProcessStepCollection, AgentOptions $anOptions = null)
 {
     Assertion::inArray($aType, array(self::SEQUENCE, self::SPLIT, self::FORK, self::LOOP));
     Assertion::allIsInstanceOf($aProcessStepCollection, 'GingerCore\\Model\\JsonWDL\\ProcessStep');
     $this->type = $aType;
     $this->processSteps = $aProcessStepCollection;
     $this->options = is_null($anOptions) ? new AgentOptions(array()) : $anOptions;
 }
開發者ID:gingerwfms,項目名稱:ginger-core,代碼行數:13,代碼來源:AgentDescription.php

示例11: __construct

 /**
  * Constructor.
  *
  * @param string $name
  * @param string $type
  * @param Photo[] $photos
  */
 public function __construct($name, $type, array $photos)
 {
     \Assert\that($name)->string()->notEmpty();
     \Assert\that($type)->string()->notEmpty();
     Assertion::allIsInstanceOf($photos, Photo::class);
     $this->name = $name;
     $this->type = $type;
     $this->photos = $photos;
 }
開發者ID:ben-gibson,項目名稱:foursquare-venue-client,代碼行數:16,代碼來源:PhotoGroup.php

示例12: __construct

 /**
  * @param FieldNode[]    $fields
  * @param Link[]         $links
  * @param ResourceNode[] $resources
  */
 public function __construct(array $fields, array $links = [], array $resources = [])
 {
     Assertion::allIsInstanceOf($fields, FieldNode::class);
     Assertion::allIsInstanceOf($links, Link::class);
     Assertion::allIsInstanceOf($resources, ResourceNode::class);
     $this->fields = $fields;
     $this->links = $links;
     $this->resources = $resources;
 }
開發者ID:tomphp,項目名稱:hal-client,代碼行數:14,代碼來源:Resource.php

示例13: __construct

 /**
  * Constructor.
  *
  * @param string $name
  * @param string $type
  * @param Tip[] $tips
  */
 public function __construct($name, $type, array $tips)
 {
     \Assert\that($name)->string()->notEmpty();
     \Assert\that($type)->string()->notEmpty();
     Assertion::allIsInstanceOf($tips, Tip::class);
     $this->name = $name;
     $this->type = $type;
     $this->tips = $tips;
 }
開發者ID:ben-gibson,項目名稱:foursquare-venue-client,代碼行數:16,代碼來源:TipGroup.php

示例14: __construct

 /**
  * @param Entity[] $entities
  */
 public function __construct(array $entities = array())
 {
     Assertion::allIsInstanceOf($entities, '\\OpenConext\\Value\\Saml\\Entity');
     foreach ($entities as $entity) {
         if ($this->contains($entity)) {
             continue;
         }
         $this->entities[] = $entity;
     }
 }
開發者ID:OpenConext,項目名稱:SamlValueObject,代碼行數:13,代碼來源:EntitySet.php

示例15: hasPermissions

 /**
  * Consider if role has a set of permissions.
  *
  * @param Permission[] $permissions Set of permissions.
  *
  * @return bool
  */
 public function hasPermissions($permissions)
 {
     Assertion::allIsInstanceOf($permissions, 'Netzmacht\\Workflow\\Security\\Permission');
     foreach ($permissions as $permission) {
         if (!$this->hasPermission($permission)) {
             return false;
         }
     }
     return true;
 }
開發者ID:netzmacht,項目名稱:workflow,代碼行數:17,代碼來源:Role.php


注:本文中的Assert\Assertion::allIsInstanceOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。