Unable to parse files containing Interface in the namespace

Hi,
Sonar scanner has issues with the word Interface in the namespace or in the use statements. I have the feeling it’s a keyword and the parser can’t deal with it. I obviously might be wrong as I’m not a sonar expert at all. Both sonarcloud via gitlab CI/CD as well as a local scanner with sonarqube produce the same issue. All files that have a namespace App\Interface or use anything from that namespace get a parse error.
Here is a sample for a file:

<?php
declare(strict_types=1);

namespace App\Interface; //<-- sonar says he can't parse this line

use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\PersistentCollection;

interface LanguageDependentInterface
{
    public function initializeMissingLanguageDependentEntity(mixed $entity): array|Collection|PersistentCollection;
...

Thanks.

1 Like

Hey there.

Thanks for the report. This is a known issue – I’ll link this community thread to the ticket to help us track users who encounter the issue.

1 Like