Skip to content

Conversation

@dereuromark
Copy link
Contributor

Try to port not maintained https://github.com/suin/phpcs-psr4-sniff

BUT:
It doesn't quite seem to work

If I have a namespace of

Foo => src/Foo

defined, It does not report issues like

Foo\Bar\Baz => src/Foo/Baaaaa/Baz

Which it should IMO

@dereuromark
Copy link
Contributor Author

Using getcwd() I think I was able to fix the base path handling, which then made it work for me.

@dereuromark
Copy link
Contributor Author

dereuromark commented Mar 29, 2024

One false positive issue left

	"autoload-dev": {
		"psr-4": {
			"QueueScheduler\\Test\\": "tests/",
			"Cake\\Test\\": "vendor/cakephp/cakephp/tests/",
			"TestApp\\": "tests/test_app/src/"
		}
	},

and

FILE: /work/git/cakephp-queue-scheduler/tests/test_app/src/Application.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 10 | ERROR | Class name is not compliant with PSR-4 configuration. It should be `QueueScheduler\Test\test_app\src\Application` instead of `TestApp\Application`. (PhpCollective.Classes.Psr4.IncorrectClassName)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants