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

  • AbstractHasDispatcher
  • Collection
  • Event
  • Version

Interfaces

  • FromConfigInterface
  • HasDispatcherInterface
  • ToArrayInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Common;
 4: 
 5: use Symfony\Component\EventDispatcher\Event as SymfonyEvent;
 6: 
 7: /**
 8:  * Default event for Guzzle notifications
 9:  */
10: class Event extends SymfonyEvent implements ToArrayInterface, \ArrayAccess, \IteratorAggregate
11: {
12:     /**
13:      * @var array
14:      */
15:     private $context;
16: 
17:     /**
18:      * Constructor
19:      *
20:      * @param array $context Contextual information
21:      */
22:     public function __construct(array $context = array())
23:     {
24:         $this->context = $context;
25:     }
26: 
27:     /**
28:      * {@inheritdoc}
29:      */
30:     public function getIterator()
31:     {
32:         return new \ArrayIterator($this->context);
33:     }
34: 
35:     /**
36:      * {@inheritdoc}
37:      */
38:     public function offsetGet($offset)
39:     {
40:         return array_key_exists($offset, $this->context) ? $this->context[$offset] : null;
41:     }
42: 
43:     /**
44:      * {@inheritdoc}
45:      */
46:     public function offsetSet($offset, $value)
47:     {
48:         $this->context[$offset] = $value;
49:     }
50: 
51:     /**
52:      * {@inheritdoc}
53:      */
54:     public function offsetExists($offset)
55:     {
56:         return array_key_exists($offset, $this->context);
57:     }
58: 
59:     /**
60:      * {@inheritdoc}
61:      */
62:     public function offsetUnset($offset)
63:     {
64:         unset($this->context[$offset]);
65:     }
66: 
67:     /**
68:      * {@inheritdoc}
69:      */
70:     public function toArray()
71:     {
72:         return $this->context;
73:     }
74: }
75: 
php-coveralls API documentation generated by ApiGen 2.8.0