Skip to content

Commit dec9660

Browse files
authored
Merge pull request #482 from dotkernel/issue-478
Issue #478: Require `symfony/var-exporter` to keep LazyGhost support
2 parents 26a869c + ba39809 commit dec9660

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
},
5050
"require": {
5151
"php": "~8.2.0 || ~8.3.0",
52-
"ext-json": "*",
5352
"ext-gd": "*",
53+
"ext-json": "*",
5454
"dotkernel/dot-annotated-services": "^4.1.7",
5555
"dotkernel/dot-cache": "^4.0",
5656
"dotkernel/dot-cli": "^3.5.0",
@@ -78,7 +78,8 @@
7878
"mezzio/mezzio-twigrenderer": "^2.15.0",
7979
"ramsey/uuid-doctrine": "^2.0.0",
8080
"roave/psr-container-doctrine": "^4.1.0",
81-
"symfony/filesystem": "^7.0.3"
81+
"symfony/filesystem": "^7.0.3",
82+
"symfony/var-exporter": "^6.4 || ^7.4"
8283
},
8384
"require-dev": {
8485
"laminas/laminas-coding-standard": "^2.5",

src/App/src/ConfigProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Api\App\Command\RouteListCommand;
88
use Api\App\Command\TokenGenerateCommand;
99
use Api\App\Entity\EntityListenerResolver;
10-
use Api\App\Factory\AuthenticationMiddlewareFactory;
1110
use Api\App\Factory\EntityListenerResolverFactory;
1211
use Api\App\Factory\RouteListCommandFactory;
1312
use Api\App\Factory\TokenGenerateCommandFactory;
@@ -63,7 +62,7 @@ public function getDependencies(): array
6362
'doctrine.entity_manager.orm_default' => EntityManagerFactory::class,
6463
'dot-mail.options.default' => MailOptionsAbstractFactory::class,
6564
'dot-mail.service.default' => MailServiceAbstractFactory::class,
66-
AuthenticationMiddleware::class => AuthenticationMiddlewareFactory::class,
65+
AuthenticationMiddleware::class => AnnotatedServiceFactory::class,
6766
AuthorizationMiddleware::class => AnnotatedServiceFactory::class,
6867
ContentNegotiationMiddleware::class => AnnotatedServiceFactory::class,
6968
Environment::class => TwigEnvironmentFactory::class,

src/App/src/Middleware/AuthenticationMiddleware.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@
66

77
use Api\App\UserIdentity;
88
use Api\User\Entity\UserRole;
9+
use Dot\AnnotatedServices\Annotation\Inject;
10+
use Mezzio\Authentication\AuthenticationInterface;
911
use Mezzio\Authentication\UserInterface;
1012
use Psr\Http\Message\ResponseInterface;
1113
use Psr\Http\Message\ServerRequestInterface;
14+
use Psr\Http\Server\MiddlewareInterface;
1215
use Psr\Http\Server\RequestHandlerInterface;
1316

14-
class AuthenticationMiddleware extends \Mezzio\Authentication\AuthenticationMiddleware
17+
class AuthenticationMiddleware implements MiddlewareInterface
1518
{
19+
/**
20+
* @Inject({
21+
* AuthenticationInterface::class,
22+
* })
23+
*/
24+
public function __construct(
25+
protected AuthenticationInterface $auth,
26+
) {
27+
}
28+
1629
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
1730
{
1831
$user = $this->auth->authenticate($request);

0 commit comments

Comments
 (0)