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


PHP ArrayIterator::append方法代码示例

本文整理汇总了PHP中ArrayIterator::append方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayIterator::append方法的具体用法?PHP ArrayIterator::append怎么用?PHP ArrayIterator::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArrayIterator的用法示例。


在下文中一共展示了ArrayIterator::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setItems

 private function setItems()
 {
     $this->items = new ArrayIterator();
     foreach ($this->rss->channel->item as $onlyItem) {
         $item = new RssItem($onlyItem->title, $onlyItem->link, $onlyItem->pubDate, $onlyItem->description);
         $this->items->append($item);
     }
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:8,代码来源:RSSReader.php

示例2: dayInfo

 private function dayInfo()
 {
     $this->daysInfo = new ArrayIterator();
     while ($this->days->valid()) {
         $day = explode(") - ", $this->days->current());
         $infos = explode("/", $day[1]);
         $this->daysInfo->append($this->buildWeatherDayInfo($day[0], $infos));
         $this->days->next();
     }
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:10,代码来源:WeatherForecast.php

示例3: append

 /**
  * {@inheritdoc}
  * @see ArrayIterator::append()
  */
 public function append($value)
 {
     if (!is_a($value, $this->getClass())) {
         throw new \InvalidArgumentException(sprintf('Only ' . $this->getClass() . ' object is allowed!'));
     }
     parent::append($value);
 }
开发者ID:recipe,项目名称:scalr,代码行数:11,代码来源:AbstractList.php

示例4: append

 /**
  * @param QueryBuilder $qb A QueryBuilder instance
  */
 public function append($qb)
 {
     if (!$qb instanceof QueryBuilder) {
         throw new \InvalidArgumentException("QuerySet will only accept QueryBuilder instances", 1);
     }
     parent::append($qb);
 }
开发者ID:nectd,项目名称:nectd-web,代码行数:10,代码来源:QuerySet.php

示例5: solveIntermediateOperationChain

 /**
  * @param \Iterator $operatorChain
  * @param \Iterator $input
  *
  * @return \ArrayIterator
  */
 private function solveIntermediateOperationChain(\Iterator $operatorChain, \Iterator $input)
 {
     $results = new \ArrayIterator();
     $input->rewind();
     $continueWIthNextItem = true;
     while ($input->valid() && $continueWIthNextItem) {
         $result = $input->current();
         $useResult = true;
         // do the whole intermediate operation chain for the current input
         $operatorChain->rewind();
         while ($operatorChain->valid() && $useResult) {
             /** @var IntermediateOperationInterface $current */
             $current = $operatorChain->current();
             // apply intermediate operations
             $result = $current->apply($result, $input->key(), $useResult, $returnedCanContinue);
             // track the continuation flags
             $continueWIthNextItem = $continueWIthNextItem && $returnedCanContinue;
             // iterate
             $operatorChain->next();
         }
         if ($useResult) {
             $results->append($result);
         }
         // goto next item
         $input->next();
     }
     return $results;
 }
开发者ID:peekandpoke,项目名称:psi,代码行数:34,代码来源:DefaultOperationChainSolver.php

示例6: setUp

    public function setUp()
    {
        $data = <<<ENDXML
        <permcheck>
            <excludes>
                <file>excluded/file5.txt</file>
                <dir>excluded2</dir>
            </excludes>
            <executables>
                <file>file1.sh</file>
                <file>file3.sh</file>
            </executables>
        </permcheck>
ENDXML;
        $this->config = \Mockery::mock(new Config());
        $this->loader = \Mockery::mock(new XmlLoader($data, $this->config));
        $this->fileSystem = \Mockery::mock(new Filesystem($this->config, '/does/not/exist'));
        $files = new \ArrayIterator();
        $mocks = array('/does/not/exist/file1.sh' => array(true, false), '/does/not/exist/file2.txt' => array(false, false), '/does/not/exist/file3.sh' => array(false, false), '/does/not/exist/file4.txt' => array(true, false), '/does/not/exist/excluded/file5.txt' => array(true, false), '/does/not/exist/excluded2/file6.sh' => array(false, false), '/does/not/exist/symlink' => array(true, true));
        foreach ($mocks as $file => $properties) {
            /** @var MockInterface|\SplFileInfo $file */
            $file = \Mockery::mock(new \SplFileInfo($file));
            $file->shouldReceive('getName')->andReturn($file);
            $file->shouldReceive('isExecutable')->andReturn($properties[0]);
            $file->shouldReceive('isLink')->andReturn($properties[1]);
            $files->append($file);
        }
        $this->fileSystem->shouldReceive('getFiles')->andReturn($files);
        $this->messageBag = \Mockery::mock(new Bag());
        $this->reporter = \Mockery::mock(new XmlReporter());
        $this->permCheck = new PermCheck($this->loader, $this->config, $this->fileSystem, $this->messageBag, $this->reporter, '/does/not/exist');
    }
开发者ID:eXistenZNL,项目名称:PermCheck,代码行数:32,代码来源:PermCheckTest.php

示例7: append

 /**
  * Bloqueia a inclusão de objetos que não seja do tipo Transaction
  *
  * @param Transaction $value
  * @throws Exception
  */
 public function append($value)
 {
     if (!$value instanceof Transaction) {
         throw new \InvalidArgumentException('Transaction object expected');
     }
     return parent::append($value);
 }
开发者ID:realejo,项目名称:ofx,代码行数:13,代码来源:TransactionList.php

示例8: smartmobileFolderTree

 /**
  * AJAX action: Check access rights for creation of a submailbox.
  *
  * Variables used:
  *   - all: (integer) If 1, return all mailboxes. Otherwise, return only
  *          INBOX, special mailboxes, and polled mailboxes.
  *
  * @return string  HTML to use for the folder tree.
  */
 public function smartmobileFolderTree()
 {
     $ftree = $GLOBALS['injector']->getInstance('IMP_Ftree');
     /* Poll all mailboxes on initial display. */
     $this->_base->queue->poll($ftree->poll->getPollList(), true);
     $iterator = new AppendIterator();
     /* Add special mailboxes explicitly. INBOX should appear first. */
     $special = new ArrayIterator();
     $special->append($ftree['INBOX']);
     foreach (IMP_Mailbox::getSpecialMailboxesSort() as $val) {
         if (isset($ftree[$val])) {
             $special->append($ftree[$val]);
         }
     }
     $iterator->append($special);
     /* Now add polled mailboxes. */
     $filter = new IMP_Ftree_IteratorFilter($ftree);
     $filter->add(array($filter::CONTAINERS, $filter::REMOTE, $filter::SPECIALMBOXES));
     if (!$this->vars->all) {
         $filter->add($filter::POLLED);
     }
     $filter->mboxes = array('INBOX');
     $iterator->append($filter);
     return $ftree->createTree($this->vars->all ? 'smobile_folders_all' : 'smobile_folders', array('iterator' => $iterator, 'render_type' => 'IMP_Tree_Jquerymobile'))->getTree(true);
 }
开发者ID:horde,项目名称:horde,代码行数:34,代码来源:Smartmobile.php

示例9: execute

 public function execute(InputInterface $input, OutputInterface $output)
 {
     $configuration = new Configuration(file_get_contents(__DIR__ . '/../../../config/config.json'));
     $resolver = new SpawnResolver($configuration, CpuInfo::detect());
     $factory = new Factory();
     $classname = $resolver->getClassName();
     if ($input->getOption('verbose')) {
         $outputLogger = new StreamHandler('php://stdout');
     } else {
         $outputLogger = new NullHandler();
     }
     $workers = new \ArrayIterator();
     for ($i = 1; $i <= $resolver->getSpawnQuantity(); $i++) {
         $output->write("Launching Worker <info>{$i}</info> ...");
         $logger = new Logger('Worker-' . $i);
         $logger->pushHandler($outputLogger);
         $logger->pushHandler(new RotatingFileHandler(__DIR__ . '/../../../logs/worker-' . $i . '.logs', 3));
         $worker = new Worker('Worker-' . $i, new \GearmanWorker(), $logger);
         foreach ($configuration['gearman-servers'] as $server) {
             $worker->addServer($server['host'], $server['port']);
         }
         $worker->setFunction(new $classname($configuration, $logger, $factory));
         $workers->append($worker);
         $output->writeln("Success !");
     }
     $manager = new ProcessManager(new EventDispatcher());
     $manager->process($workers, function (Worker $worker) {
         $worker->run();
     });
 }
开发者ID:nlegoff,项目名称:Worker,代码行数:30,代码来源:RunWorkers.php

示例10: append

 /**
  * Appends a new collection entry
  *
  * @param \MarkdownExtended\API\ContentInterface $content
  *
  * @throws \MarkdownExtended\Exception\UnexpectedValueException it the argument does not implement `\MarkdownExtended\API\ContentInterface`
  */
 public function append($content)
 {
     if (!is_object($content) || !Kernel::valid($content, Kernel::TYPE_CONTENT)) {
         throw new UnexpectedValueException(sprintf('Method "%s" expects a "%s" parameter object, got "%s"', __METHOD__, Kernel::CONTENT_INTERFACE, is_object($content) ? get_class($content) : gettype($content)));
     }
     parent::append($content);
 }
开发者ID:atelierspierrot,项目名称:markdown-extended,代码行数:14,代码来源:ContentCollection.php

示例11: mapNotificationDevices

 /**
  * @param NotificationEntity $notificationEntity
  * @return \ArrayIterator
  */
 protected function mapNotificationDevices(NotificationEntity $notificationEntity)
 {
     $devices = new \ArrayIterator();
     foreach ($notificationEntity->getDevices() as $device) {
         $devices->append($this->deviceMapper->mapEntityToModel($device, $notificationEntity->getType()));
     }
     return $devices;
 }
开发者ID:zbox,项目名称:UnifiedPushBundle,代码行数:12,代码来源:NotificationMapper.php

示例12: map

 public static final function map(\Traversable $traversable, UnaryFunktionInterface $functor) : \Traversable
 {
     $result = new \ArrayIterator();
     foreach ($traversable as $value) {
         $result->append($functor->apply($value));
     }
     return $result;
 }
开发者ID:intrawarez,项目名称:sabertooth,代码行数:8,代码来源:Traversables.php

示例13: append

 /**
  * @param mixed $value
  *
  * @return $this
  */
 public function append($value)
 {
     if (is_scalar($value)) {
         $value = $this->ownerDocument->createText($value);
     }
     parent::append($value);
     return $this;
 }
开发者ID:volux,项目名称:dom,代码行数:13,代码来源:Set.php

示例14: getKeys

 /**
  * @return array|\ArrayIterator
  */
 public function getKeys()
 {
     $keys = new \ArrayIterator();
     foreach ($this as $key => $row) {
         $keys->append($key);
     }
     return $keys;
 }
开发者ID:hcelebi,项目名称:url-parser-tool,代码行数:11,代码来源:Query.php

示例15: append

 /**
  * {@inheritdoc}
  * @see ArrayIterator::append()
  */
 public function append($value)
 {
     $strictClass = $this->getClass();
     if ($strictClass !== null && !is_a($value, $strictClass)) {
         throw new \InvalidArgumentException(sprintf('Only %s object is allowed to append!', $strictClass));
     }
     parent::append($value);
 }
开发者ID:mheydt,项目名称:scalr,代码行数:12,代码来源:AbstractListDataType.php


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