| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | public function testGetHandler() |
||
| 42 | { |
||
| 43 | $signalHandler = SignalHandler::getInstance(); |
||
| 44 | $handler = function(){ |
||
| 45 | $this->username = 'foo'; |
||
|
|
|||
| 46 | }; |
||
| 47 | $signalHandler->register(SIGUSR1, $handler); |
||
| 48 | $handler1 = $signalHandler->getHandler(SIGUSR1); |
||
| 49 | $this->assertTrue($handler === $handler1); |
||
| 50 | } |
||
| 51 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: