Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function testContainer() |
||
21 | { |
||
22 | $settings = ['a', 'b']; |
||
23 | |||
24 | $container = new Container(); |
||
25 | $container['settings'] = $settings; |
||
26 | |||
27 | $controller = new Base; |
||
28 | $controller->setContainer($container); |
||
29 | |||
30 | static::assertInstanceOf('\Slim\Container', $controller->getContainer()); |
||
31 | static::assertEquals(true, isset($controller->settings)); |
||
32 | static::assertEquals($settings, $controller->settings); |
||
|
|||
33 | } |
||
34 | } |
||
35 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.