website/errors/function.duplicate.md
This error is reported when the same function name is declared in multiple files within the analysed codebase:
// file1.php
<?php declare(strict_types = 1);
namespace App;
function helper(): void
{
}
// file2.php
<?php declare(strict_types = 1);
namespace App;
function helper(): void
{
}
The same function name is declared multiple times within the registered stub files.
Remove the duplicate function declaration, keeping only one:
<?php declare(strict_types = 1);
// file2.php
namespace App;
-function helper(): void
-{
-}
If both declarations are intentionally different, rename one of them:
<?php declare(strict_types = 1);
// file2.php
namespace App;
-function helper(): void
+function helperAlternative(): void
{
}