Various code cleanup as suggested by PHPStorm.

This commit is contained in:
James Cole
2019-05-30 12:39:06 +02:00
parent 8b7e87ae57
commit eb6329e556
36 changed files with 631 additions and 625 deletions

View File

@@ -56,32 +56,6 @@ class Controller extends BaseController
$this->parameters = $this->getParameters();
}
/**
* Method to help build URI's.
*
* @return string
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
protected function buildParams(): string
{
$return = '?';
$params = [];
foreach ($this->parameters as $key => $value) {
if ('page' === $key) {
continue;
}
if ($value instanceof Carbon) {
$params[$key] = $value->format('Y-m-d');
continue;
}
$params[$key] = $value;
}
$return .= http_build_query($params);
return $return;
}
/**
* Method to grab all parameters from the URI.
*
@@ -125,4 +99,30 @@ class Controller extends BaseController
return $bag;
}
/**
* Method to help build URI's.
*
* @return string
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
protected function buildParams(): string
{
$return = '?';
$params = [];
foreach ($this->parameters as $key => $value) {
if ('page' === $key) {
continue;
}
if ($value instanceof Carbon) {
$params[$key] = $value->format('Y-m-d');
continue;
}
$params[$key] = $value;
}
$return .= http_build_query($params);
return $return;
}
}