Skip to content

Commit

Permalink
Change 'Route::persistParams()` to protected.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Mar 16, 2015
1 parent 7f62d57 commit 00e056c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Routing/Route/Route.php
Expand Up @@ -385,11 +385,8 @@ protected function _parseArgs($args, $context)
* @param array $params An array of persistent values to replace persistent ones.
* @return array An array with persistent parameters applied.
*/
public function persistParams(array $url, array $params)
protected function _persistParams(array $url, array $params)
{
if (empty($this->options['persist']) || !is_array($this->options['persist'])) {
return $url;
}
foreach ($this->options['persist'] as $persistKey) {
if (array_key_exists($persistKey, $params) && !isset($url[$persistKey])) {
$url[$persistKey] = $params[$persistKey];
Expand Down Expand Up @@ -419,7 +416,11 @@ public function match(array $url, array $context = [])
$defaults = $this->defaults;
$context += ['params' => []];

$url = $this->persistParams($url, $context['params']);
if (!empty($this->options['persist']) &&
is_array($this->options['persist'])
) {
$url = $this->_persistParams($url, $context['params']);
}
unset($context['params']);
$hostOptions = array_intersect_key($url, $context);

Expand Down

0 comments on commit 00e056c

Please sign in to comment.