Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
52 | private static function &getStorage(ServerRequestInterface $request, $key = null) |
||
53 | { |
||
54 | if (!self::hasAttribute($request, Middleware::STORAGE_KEY)) { |
||
55 | throw new RuntimeException('No session storage initialized'); |
||
56 | } |
||
57 | |||
58 | $storage = self::getAttribute($request, Middleware::STORAGE_KEY); |
||
59 | |||
60 | if (!isset($storage->$key)) { |
||
61 | $storage->$key = []; |
||
62 | } |
||
63 | |||
64 | return $storage->$key; |
||
65 | } |
||
66 | } |
||
67 |