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