Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractResourceIteratorFactory
  • CompositeResourceIteratorFactory
  • MapResourceIteratorFactory
  • Model
  • ResourceIterator
  • ResourceIteratorApplyBatched
  • ResourceIteratorClassFactory

Interfaces

  • ResourceIteratorFactoryInterface
  • ResourceIteratorInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Service\Resource;
 4: 
 5: use Guzzle\Service\Command\CommandInterface;
 6: 
 7: /**
 8:  * Resource iterator factory used when explicitly mapping strings to iterator classes
 9:  */
10: class MapResourceIteratorFactory extends AbstractResourceIteratorFactory
11: {
12:     /**
13:      * @var array Associative array mapping iterator names to class names
14:      */
15:     protected $map;
16: 
17:     /**
18:      * @param array $map Associative array mapping iterator names to class names
19:      */
20:     public function __construct(array $map)
21:     {
22:         $this->map = $map;
23:     }
24: 
25:     /**
26:      * {@inheritdoc}
27:      */
28:     public function getClassName(CommandInterface $command)
29:     {
30:         $className = $command->getName();
31: 
32:         if (isset($this->map[$className])) {
33:             return $this->map[$className];
34:         } elseif (isset($this->map['*'])) {
35:             // If a wildcard was added, then always use that
36:             return $this->map['*'];
37:         }
38: 
39:         return null;
40:     }
41: }
42: 
php-coveralls API documentation generated by ApiGen 2.8.0