Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Sep 8, 2017
1 parent cd11b14 commit 758ccad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions system/src/Grav/Common/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function setConfig(Config $config)
/**
* Get configuration of the plugin.
*
* @return Config
* @return array
*/
public function config()
{
Expand Down Expand Up @@ -121,7 +121,7 @@ protected function isPluginActiveAdmin($plugin_route)

if (strpos($uri->path(), $this->config->get('plugins.admin.route') . '/' . $plugin_route) === false) {
$should_run = false;
} elseif (isset($uri->paths()[1]) && $uri->paths()[1] == $plugin_route) {
} elseif (isset($uri->paths()[1]) && $uri->paths()[1] === $plugin_route) {
$should_run = true;
}

Expand Down Expand Up @@ -207,6 +207,7 @@ public function offsetGet($offset)
*
* @param mixed $offset The offset to assign the value to.
* @param mixed $value The value to set.
* @throws LogicException
*/
public function offsetSet($offset, $value)
{
Expand All @@ -217,6 +218,7 @@ public function offsetSet($offset, $value)
* Unsets an offset.
*
* @param mixed $offset The offset to unset.
* @throws LogicException
*/
public function offsetUnset($offset)
{
Expand Down Expand Up @@ -299,13 +301,14 @@ protected function mergeConfig(Page $page, $deep = false, $params = [], $type =
*/
private function mergeArrays($deep = false, $array1, $array2)
{
if ($deep == 'merge') {
if ($deep === 'merge') {
return Utils::arrayMergeRecursiveUnique($array1, $array2);
} elseif ($deep === true) {
}
if ($deep === true) {
return array_replace_recursive($array1, $array2);
} else {
return array_merge($array1, $array2);
}

return array_merge($array1, $array2);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function query($id = null, $raw = false)
* @param string $id Optional parameter name.
* @param boolean $array return the array format or not
*
* @return null|string
* @return null|string|array
*/
public function params($id = null, $array = false)
{
Expand Down

0 comments on commit 758ccad

Please sign in to comment.