Skip to content

Commit

Permalink
uses DI\Helpers::escape()
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 31, 2020
1 parent e1efceb commit b2bf38f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"require": {
"php": ">=7.2 <8.1",
"nette/di": "^3.0.3",
"nette/di": "^3.0.5",
"nette/utils": "^3.0"
},
"suggest": {
Expand Down
16 changes: 1 addition & 15 deletions src/Bootstrap/Configurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function generateContainer(DI\Compiler $compiler): void
}
}

$compiler->addConfig(['parameters' => self::escape($this->staticParameters)]);
$compiler->addConfig(['parameters' => DI\Helpers::escape($this->staticParameters)]);
$compiler->setDynamicParameterNames(array_keys($this->dynamicParameters));

$builder = $compiler->getContainerBuilder();
Expand Down Expand Up @@ -353,20 +353,6 @@ public static function detectDebugMode($list = null): bool
}
return in_array($addr, $list, true) || in_array("$secret@$addr", $list, true);
}


/**
* Expand counterpart.
*/
private static function escape($value)
{
if (is_array($value)) {
return array_map([self::class, 'escape'], $value);
} elseif (is_string($value)) {
return str_replace('%', '%%', $value);
}
return $value;
}
}


Expand Down

0 comments on commit b2bf38f

Please sign in to comment.