Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maintenance] Drop Sf4 ACL on parameters class due to lack of its support #445

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions src/Bundle/Controller/Parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,18 @@ public function get(string $key, $default = null): mixed
$result = $default;
}

return $result;
}
}
} elseif (Kernel::MAJOR_VERSION === 5) {
class Parameters extends ParameterBag
{
/**
* @param mixed $default
*
* @return mixed
*/
public function get(string $key, $default = null)
{
$result = parent::get($key, $default);

if (null === $result && $default !== null && $this->has($key)) {
$result = $default;
}

return $result;
}
}
} else {
class Parameters extends ParameterBag
{
/**
* @param string $key
* @param mixed $default
*
* @return mixed
*/
public function get($key, $default = null)
public function get(string $key, $default = null)
{
$result = parent::get($key, $default);

Expand Down