Skip to content

Commit

Permalink
Removing PHP7 specific syntax for PHP5.6 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
CashWilliams committed Aug 23, 2016
1 parent 0f239b0 commit 645e243
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drupen.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
4 changes: 2 additions & 2 deletions src/ParamHandler/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/ParamHandler/ParameterHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions src/RouteHandler/DefaultHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ 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;
}
}
}

protected function getParameters(string $type) : array {
protected function getParameters($type) {
$handler = $this->getParameterHandler($type);
if ($handler) {
return $handler->getParameters($type);
Expand Down

0 comments on commit 645e243

Please sign in to comment.