Remove PHP7 typing

This commit is contained in:
Aaron Carlino 2019-08-22 11:40:13 +12:00
parent cda988b4e0
commit 9fc369fa33
2 changed files with 7 additions and 11 deletions

View File

@ -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.

View File

@ -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