Overview

Namespaces

  • Evenement
  • None
  • PHP
  • Psr
    • Http
      • Message
  • Ratchet
    • Http
    • RFC6455
      • Handshake
      • Messaging
    • Server
    • Session
      • Serialize
      • Storage
        • Proxy
    • Wamp
    • WebSocket
  • React
    • EventLoop
      • Tick
      • Timer
    • Socket
    • Stream
  • Symfony
    • Component
      • HttpFoundation
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
      • Routing
        • Annotation
        • Exception
        • Generator
          • Dumper
        • Loader
          • DependencyInjection
        • Matcher
          • Dumper
        • Tests
          • Annotation
          • Fixtures
            • AnnotatedClasses
            • OtherAnnotatedClasses
          • Generator
            • Dumper
          • Loader
          • Matcher
            • Dumper

Classes

  • AbstractConnectionDecorator
  • App

Interfaces

  • ComponentInterface
  • ConnectionInterface
  • MessageComponentInterface
  • MessageInterface

Constants

  • VERSION
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Ratchet;
 3: 
 4: /**
 5:  * Wraps ConnectionInterface objects via the decorator pattern but allows
 6:  * parameters to bubble through with magic methods
 7:  * @todo It sure would be nice if I could make most of this a trait...
 8:  */
 9: abstract class AbstractConnectionDecorator implements ConnectionInterface {
10:     /**
11:      * @var ConnectionInterface
12:      */
13:     protected $wrappedConn;
14: 
15:     public function __construct(ConnectionInterface $conn) {
16:         $this->wrappedConn = $conn;
17:     }
18: 
19:     /**
20:      * @return ConnectionInterface
21:      */
22:     protected function getConnection() {
23:         return $this->wrappedConn;
24:     }
25: 
26:     public function __set($name, $value) {
27:         $this->wrappedConn->$name = $value;
28:     }
29: 
30:     public function __get($name) {
31:         return $this->wrappedConn->$name;
32:     }
33: 
34:     public function __isset($name) {
35:         return isset($this->wrappedConn->$name);
36:     }
37: 
38:     public function __unset($name) {
39:         unset($this->wrappedConn->$name);
40:     }
41: }
42: 
Ratchet API documentation generated by ApiGen 2.8.0