当前位置: 首页>>代码示例>>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;未经允许,请勿转载。