From 9fc369fa33877d55026e85bd114137c146362135 Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Thu, 22 Aug 2019 11:40:13 +1200 Subject: [PATCH] Remove PHP7 typing --- README.md | 6 +----- src/Extension/BetterNavigatorExtension.php | 12 ++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4ca4f97..b52d54b 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ You can disable the navigator using your own custom logic by defining a `showBet method in any controller with the extension applied. ```php -public function showBetterNavigator(): bool +public function showBetterNavigator() { // A user-defined setting return $this->ShowDebugTools; @@ -69,10 +69,6 @@ All content, scripts and CSS are loaded via the BetterNavigator.ss template, so The BetterNavigator.ss template's scope is set to the page that is being viewed, so any methods available in your page controller will be available in the BetterNavigator.ss template. This should allow you to add custom links by page type and introduce complex logic if you want to. -## Known issues - - * Probably won't work in IE8 or lower. - ## Bonus: better debugging tools This module provide quick access to SilverStripe's built in [URL Variable Tools](http://doc.silverstripe.org/framework/en/reference/urlvariabletools) but reading their output isn't much fun. You can peek under SilverStripe's hood much more conveniently using the recently released [SilverStripe Clockwork](https://github.com/markguinn/silverstripe-clockwork) by Mark Guinn. Out of the box SQL Queries and controller events are logged. It's Chrome only for now. diff --git a/src/Extension/BetterNavigatorExtension.php b/src/Extension/BetterNavigatorExtension.php index d798d94..43e97ce 100644 --- a/src/Extension/BetterNavigatorExtension.php +++ b/src/Extension/BetterNavigatorExtension.php @@ -30,7 +30,7 @@ class BetterNavigatorExtension extends DataExtension * Load requirements in before final render. When the next extension point is called, it's too late. * @return void */ - public function beforeCallActionHandler(): void + public function beforeCallActionHandler() { if ($this->shouldDisplay()) { Requirements::javascript('jonom/silverstripe-betternavigator: javascript/betternavigator.js'); @@ -44,7 +44,7 @@ class BetterNavigatorExtension extends DataExtension * @param DBHTMLText $result * @return DBHTMLText */ - public function afterCallActionHandler($request, $action, $result): DBHTMLText + public function afterCallActionHandler($request, $action, $result) { if (!$this->shouldDisplay()) { return $result; @@ -68,7 +68,7 @@ class BetterNavigatorExtension extends DataExtension * Override on a per-controller basis to add custom logic * @return bool */ - public function showBetterNavigator(): bool + public function showBetterNavigator() { return true; } @@ -79,7 +79,7 @@ class BetterNavigatorExtension extends DataExtension * * @return DBHTMLText */ - private function generateNavigator(): DBHTMLText + private function generateNavigator() { // Get SilverStripeNavigator links & stage info (CMS/Stage/Live/Archive) $nav = []; @@ -136,7 +136,7 @@ class BetterNavigatorExtension extends DataExtension * Internally compute and cache weather the navigator should display * @return bool */ - private function shouldDisplay(): bool + private function shouldDisplay() { if ($this->shouldDisplay !== null) { return $this->shouldDisplay; @@ -157,7 +157,7 @@ class BetterNavigatorExtension extends DataExtension /** * @return boolean */ - private function isAPage(): bool + private function isAPage() { return $this->owner && $this->owner->dataRecord