Skip to content

Commit 498c4f3

Browse files
[HttpKernel] Add #[AsController] attribute for declaring listeners on PHP 8
1 parent 10edde8 commit 498c4f3

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Attribute/AsController.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\HttpKernel\Attribute;
13+
14+
/**
15+
* Service tag to autoconfigure controllers.
16+
*/
17+
#[\Attribute(\Attribute::TARGET_CLASS)]
18+
class AsController
19+
{
20+
public function __construct()
21+
{
22+
}
23+
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ CHANGELOG
1111
* Deprecate returning a `ContainerBuilder` from `KernelInterface::registerContainerConfiguration()`
1212
* Deprecate `HttpKernelInterface::MASTER_REQUEST` and add `HttpKernelInterface::MAIN_REQUEST` as replacement
1313
* Deprecate `KernelEvent::isMasterRequest()` and add `isMainRequest()` as replacement
14+
* Add `#[AsController]` attribute for declaring standalone controllers on PHP 8
1415

1516
5.2.0
1617
-----

0 commit comments

Comments
 (0)