Skip to content

Commit

Permalink
Fix deprecated notice:
Browse files Browse the repository at this point in the history
Since symfony/http-foundation 5.1: Retrieving a non-scalar value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and will throw a "Symfony\Component\HttpFoundation\Exception\BadRequestException" exception in Symfony 6.0, use "Symfony\Component\HttpFoundation\InputBag::all($key)" instead.
  • Loading branch information
as247 committed Nov 15, 2023
1 parent 455ad9e commit 2649c03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/WpStarter/Http/Concerns/InteractsWithInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use WpStarter\Support\Facades\Date;
use SplFileInfo;
use stdClass;
use Symfony\Component\HttpFoundation\InputBag;
use Symfony\Component\VarDumper\VarDumper;

trait InteractsWithInput
Expand Down Expand Up @@ -507,6 +508,10 @@ protected function retrieveItem($source, $key, $default)
return $this->$source->all();
}

if ($this->$source instanceof InputBag) {
return $this->$source->all()[$key] ?? $default;
}

return $this->$source->get($key, $default);
}

Expand Down

0 comments on commit 2649c03

Please sign in to comment.