Closed
Description
Symfony version(s) affected: 5.3.0 beta1
Description
I tried to update my blog to 5.3 beta1 (current version 5.2.6) and I get the following error :
Unknown property "en" on annotation "Symfony\Component\Routing\Annotation\Route" in /Users/coil/Sites/strangebuzz.com/config/routes/../../src/Controller/ (which is being imported from "/Users/coil/Sites/strangebuzz.com/config/routes/annotations.yaml"). Make sure to use PHP 8+ or that annotations are installed and enabled.
How to reproduce
The error seems to come from my i18n routes, for example:
use Symfony\Component\Routing\Annotation\Route;
/**
* App generic actions and locales root handling.
*/
final class AppController extends AbstractController
{
/**
* @Route({"en": "/en", "fr": "/fr"}, name="homepage")
*
* @param array<string,int> $goals
*/
public function homepage(string $_locale, array $goals, ArticleRepository $articleRepository): Response
{
Where we have the "en" parameter that is pointed out by the error message.
Possible Solution
Additional context
- PHP 7.4.13
Route.php
if (!method_exists($this, $method)) {
throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, static::class));
}