Skip to content

Commit

Permalink
replace usage of $this->content for $content to prevent type mismatch (
Browse files Browse the repository at this point in the history
…#48)

* replace usage of $this->content for $content to prevent type mismatch

* Fix setLaravelSession with SessionDecorator

* fix dependencies versions. fix minor style
  • Loading branch information
fmarquesto authored Jul 16, 2024
1 parent 86d47ce commit c84f168
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"mockery/mockery": "~1.0",
"phpunit/phpunit": "^9.0|^10.0",
"squizlabs/php_codesniffer": "~2.0",
"php-open-source-saver/jwt-auth": "^1.4"
"php-open-source-saver/jwt-auth": "^1.4 | ^2.2"
},
"suggest": {
"php-open-source-saver/jwt-auth": "Protect your API with JSON Web Tokens."
Expand Down
6 changes: 4 additions & 2 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Dingo\Api\Http\Parser\Accept;
use Illuminate\Http\Request as IlluminateRequest;
use Dingo\Api\Contract\Http\Request as RequestInterface;
use Illuminate\Session\SymfonySessionDecorator;
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;

class Request extends IlluminateRequest implements RequestInterface
Expand Down Expand Up @@ -37,8 +38,9 @@ public function createFromIlluminate(IlluminateRequest $old)
);

try {
if ($session = $old->getSession()) {
$new->setLaravelSession($old->getSession());
$session = $old->getSession();
if ($session instanceof SymfonySessionDecorator) {
$new->setLaravelSession($session->store);
}
} catch (SessionNotFoundException $exception) {
}
Expand Down

0 comments on commit c84f168

Please sign in to comment.