ClassMustBeFinal tries to insert final into strange places.
Psalm 6.12.0@cf420941d061a57050b6c468ef2c778faf40aee2
Odd places such as inserting final before the initial <?php
diff --git a/src/Application.php b/src/Application.php
--- a/src/Application.php (revision 1c2b1fbab260d4d4b4c17f9068947f8e9b418d70)
+++ b/src/Application.php (date 1748664994185)
@@ -1,4 +1,4 @@
-<?php
+final <?php
namespace HenkPoley\DocBlockDoctor;
Or in the middle of the use list.
diff --git a/src/AstUtils.php b/src/AstUtils.php
--- a/src/AstUtils.php (revision 1c2b1fbab260d4d4b4c17f9068947f8e9b418d70)
+++ b/src/AstUtils.php (date 1748664994185)
@@ -3,7 +3,7 @@
namespace HenkPoley\DocBlockDoctor;
use PhpParser\Node;
-use PhpParser\Node\Expr\Assign;
+final use PhpParser\Node\Expr\Assign;
use PhpParser\NodeFinder;
/**
From this code at revision 1c2b1fb https://github.com/HenkPoley/PhpDocBlockDoctor/commit/1c2b1fbab260d4d4b4c17f9068947f8e9b418d70
Hey @HenkPoley, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.
This does not appear to emit any 'ERROR:'. So it is not possible to reproduce on the demo page of https://psalm.dev/
--no-cache nor --clear-cache / --clear-global-cache has any influence.
So it is not #11299.
In particular, running psalm without --alter, does not emit any ERROR: ClassMustBeFinal.
I am seeing similar
-<?php
+final <?php
namespace Database\Seeders;
@@ -14,69 +14,4 @@
class UserSeeder extends Seeder
{
I am also using "psalm/plugin-laravel": "^3.0", if that has any bearing on it.
Same here (Psalm 6.13.0) :
-use My\App\Config\Config;
+ufinal se My\App\Config\Config;
-<?php
+final <?php
This issue makes fixer unusable. Patch from linked PR works