| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | protected function makePage($priority = 100, $badge = null) |
||
| 40 | { |
||
| 41 | $page = new Page($this); |
||
| 42 | $page->setPriority($priority) |
||
| 43 | ->setIcon($this->getIcon()) |
||
| 44 | ->setAccessLogic(function () { |
||
| 45 | return $this->isView(); |
||
| 46 | }); |
||
| 47 | |||
| 48 | if ($badge) { |
||
| 49 | if (!($badge instanceof BadgeInterface)) { |
||
| 50 | $badge = new Badge($badge); |
||
| 51 | } |
||
| 52 | $page->addBadge($badge); |
||
| 53 | } |
||
| 54 | |||
| 55 | return $page; |
||
| 56 | } |
||
| 57 | |||
| 82 |
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: