1 | <?php |
||
37 | class ContextSession extends HashMap implements SessionInterface |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The connection instances. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $connections = null; |
||
46 | |||
47 | /** |
||
48 | * The session ID used for the connection. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $sessionId = null; |
||
53 | |||
54 | /** |
||
55 | * The servlet request to load the session ID used for the connection. |
||
56 | * |
||
57 | * @var string |
||
58 | */ |
||
59 | protected $servletRequest = null; |
||
60 | |||
61 | /** |
||
62 | * Initializes the session with the connection. |
||
63 | * |
||
64 | * @param \AppserverIo\RemoteMethodInvocation\ConnectionInterface $connection The connection for the session |
||
65 | */ |
||
66 | 1 | public function __construct(ConnectionInterface $connection) |
|
78 | |||
79 | /** |
||
80 | * Injects the servlet request to load the session ID, for the remote method call, from. |
||
81 | * |
||
82 | * @param \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest The servlet request instance to inject |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | public function injectServletRequest(HttpServletRequestInterface $servletRequest) |
||
90 | |||
91 | /** |
||
92 | * Returns the servlet request instance to load the session ID from. |
||
93 | * |
||
94 | * @return \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The servlet request instance |
||
95 | */ |
||
96 | public function getServletRequest() |
||
100 | |||
101 | /** |
||
102 | * Add's the passed connection to the session's connection collection. |
||
103 | * |
||
104 | * @param \AppserverIo\RemoteMethodInvocation\ConnectionInterface $connection The connection instance to add |
||
105 | * |
||
106 | * @return void |
||
107 | */ |
||
108 | 1 | public function addConnection(ConnectionInterface $connection) |
|
112 | |||
113 | /** |
||
114 | * Returns the collection with the session's connections. |
||
115 | * |
||
116 | * @return array The collection with the session's connections |
||
117 | */ |
||
118 | public function getConnections() |
||
122 | |||
123 | /** |
||
124 | * Returns the connection instance. |
||
125 | * |
||
126 | * @param integer $key The key of the connection to return |
||
127 | * |
||
128 | * @return \AppserverIo\RemoteMethodInvocation\ConnectionInterface The connection instance |
||
129 | */ |
||
130 | public function getConnection($key = 0) |
||
134 | |||
135 | /** |
||
136 | * Returns the ID of the session to use for connecting to the SFSBs. |
||
137 | * |
||
138 | * @return string The session ID |
||
139 | * @see \AppserverIo\RemoteMethodInvocation\SessionInterface::getSessionId() |
||
140 | */ |
||
141 | public function getSessionId() |
||
158 | |||
159 | /** |
||
160 | * The session ID to use. |
||
161 | * |
||
162 | * @param string $sessionId The session ID to use |
||
163 | * |
||
164 | * @return void |
||
165 | */ |
||
166 | public function setSessionId($sessionId) |
||
170 | |||
171 | /** |
||
172 | * Invokes the remote method over the connection. |
||
173 | * |
||
174 | * @param \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface $remoteMethod The remote method call to invoke |
||
175 | * |
||
176 | * @return mixed the method return value |
||
177 | * @see \AppserverIo\RemoteMethodInvocation\SessionInterface::send() |
||
178 | * @todo Refactor to replace check for 'setSession' method, e. g. check for an interface |
||
179 | */ |
||
180 | public function send(RemoteMethodInterface $remoteMethod) |
||
200 | |||
201 | /** |
||
202 | * Creates a remote initial context instance. |
||
203 | * |
||
204 | * @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy for the initial context |
||
205 | * @see \AppserverIo\RemoteMethodInvocation\SessionInterface::createInitialContext() |
||
206 | */ |
||
207 | public function createInitialContext() |
||
213 | } |
||
214 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: