| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function create($service, array $params = array()) |
||
| 20 | { |
||
| 21 | $request = Injector::inst()->get(HTTPRequest::class); |
||
| 22 | $id = $request->param('ID'); |
||
| 23 | |||
| 24 | if ($id) { |
||
| 25 | $page = SiteTree::get()->byID($id); |
||
| 26 | if ($page && $this->isEnabled($page)) { |
||
| 27 | return Injector::inst()->create(CMSPageHistoryViewerController::class); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | // Injector is not used to prevent an infinite loop |
||
| 32 | return new CMSPageHistoryController(); |
||
| 33 | } |
||
| 48 |