Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CS errors and issues reported by static analyzers #14189

Merged
merged 2 commits into from
Jan 20, 2020
Merged

Conversation

ADmad
Copy link
Member

@ADmad ADmad commented Jan 18, 2020

The phpcs ignores can be removed once slevomat/coding-standard#851 is addressed.

@ADmad ADmad added this to the 4.0.3 milestone Jan 18, 2020
@@ -55,8 +55,7 @@ public function setIo(ConsoleIo $io): void
* Part of the template method for Cake\Core\ObjectRegistry::load()
*
* @param string $class Partial classname to resolve.
* @return string|null Either the correct class name or null.
* @psalm-return class-string
* @return class-string|null Either the correct class name or null.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeResolver doesn't seem to handle class-string yet. Maybe I can add it in a PR.

@@ -36,8 +36,7 @@ class CacheRegistry extends ObjectRegistry
* Part of the template method for Cake\Core\ObjectRegistry::load()
*
* @param string $class Partial classname to resolve.
* @return string|null Either the correct classname or null.
* @psalm-return class-string
* @return class-string|null Either the correct classname or null.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldnt do this yet.

@othercorey
Copy link
Member

Opened PR for class-string support in TypeResolver so we don't have to rely on psalm-specific annotations.

phpDocumentor/TypeResolver#90

@ADmad
Copy link
Member Author

ADmad commented Jan 19, 2020

Both phpstan and psalm (and even phan) support class-string, so others should catch up.

@dereuromark
Copy link
Member

Maybe not IDEs and other tools? For them it is still string.

@othercorey othercorey merged commit 06b5ca8 into master Jan 20, 2020
@othercorey othercorey deleted the cs-stan branch January 20, 2020 08:56
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.

None yet

3 participants