From 645e24358a057953f421f625bd8628f7110aa458 Mon Sep 17 00:00:00 2001 From: Cash Williams Date: Tue, 23 Aug 2016 11:00:28 -0500 Subject: [PATCH] Removing PHP7 specific syntax for PHP5.6 compatibility. --- drupen.drush.inc | 2 +- src/ParamHandler/Entity.php | 4 ++-- src/ParamHandler/ParameterHandlerInterface.php | 4 ++-- src/RouteHandler/DefaultHandler.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drupen.drush.inc b/drupen.drush.inc index 0f3a4b7..2e8573e 100644 --- a/drupen.drush.inc +++ b/drupen.drush.inc @@ -283,7 +283,7 @@ function loadURL($url) { * @param array $results * @param \array[] ...$arrays */ -function generatePermutations(string $separator, array &$results, array ...$arrays) { +function generatePermutations($separator, array &$results, array ...$arrays) { $empty = empty($results); $array = array_shift($arrays); $new_results = []; diff --git a/src/ParamHandler/Entity.php b/src/ParamHandler/Entity.php index 4101994..4519d95 100644 --- a/src/ParamHandler/Entity.php +++ b/src/ParamHandler/Entity.php @@ -20,11 +20,11 @@ public function __construct(EntityTypeManager $entity_type_manager) { $this->entityTypeManager = $entity_type_manager; } - public function applies(string $type) : bool { + public function applies($type) { return substr($type, 0, 7) == 'entity:' && $type[7] != '{'; } - public function getParameters(string $type) : array { + public function getParameters($type) { list(, $entity_type) = explode(':', $type); // Load all entities of a given type. return array_keys($this->entityTypeManager->getStorage($entity_type)->loadMultiple()); diff --git a/src/ParamHandler/ParameterHandlerInterface.php b/src/ParamHandler/ParameterHandlerInterface.php index c892704..1be5a9a 100644 --- a/src/ParamHandler/ParameterHandlerInterface.php +++ b/src/ParamHandler/ParameterHandlerInterface.php @@ -9,7 +9,7 @@ interface ParameterHandlerInterface { - public function applies(string $type) : bool ; + public function applies($type); - public function getParameters(string $type) : array ; + public function getParameters($type); } diff --git a/src/RouteHandler/DefaultHandler.php b/src/RouteHandler/DefaultHandler.php index 53d370f..17110c1 100644 --- a/src/RouteHandler/DefaultHandler.php +++ b/src/RouteHandler/DefaultHandler.php @@ -62,7 +62,7 @@ public function getUrls(RouteCollection $collection) { return $urls; } - protected function getParameterHandler(string $type) { + protected function getParameterHandler($type) { foreach ($this->paramHandler->getHandlers() as $handler) { if ($handler->applies($type)) { return $handler; @@ -70,7 +70,7 @@ protected function getParameterHandler(string $type) { } } - protected function getParameters(string $type) : array { + protected function getParameters($type) { $handler = $this->getParameterHandler($type); if ($handler) { return $handler->getParameters($type);