| Conditions | 3 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 6 | public function __construct($databaseRecord, $log = self::SUPPRESS_LOG, $user = self::SUPPRESS_USER) |
|
| 36 | { |
||
| 37 | 6 | parent::__construct($databaseRecord); |
|
| 38 | |||
| 39 | 5 | if ($log instanceof Log) { |
|
| 40 | 3 | $this->log = $log; |
|
|
|
|||
| 41 | } |
||
| 42 | 5 | if ($user instanceof User) { |
|
| 43 | 3 | $this->user = $user; |
|
| 44 | } |
||
| 45 | 5 | } |
|
| 46 | } |
||
| 47 |
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: