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

Update for Cake 5. #836

Merged
merged 1 commit into from
Jun 25, 2022
Merged

Update for Cake 5. #836

merged 1 commit into from
Jun 25, 2022

Conversation

ADmad
Copy link
Member

@ADmad ADmad commented Jun 25, 2022

No description provided.

@ADmad ADmad force-pushed the cake5-updates branch 5 times, most recently from 859320d to da49353 Compare June 25, 2022 12:58
@ADmad
Copy link
Member Author

ADmad commented Jun 25, 2022

@othercorey Slevomat CS is barfing on tests/TestCase/Command/TemplateCommandTest.php, any idea how to fix/figure out the cause?

EDIT: Figured it out. It blew up because a docblock had @param $name instead of @param string $name.

@ADmad ADmad force-pushed the cake5-updates branch 5 times, most recently from d6cbe1a to df53683 Compare June 25, 2022 13:29
@othercorey
Copy link
Member

@othercorey Slevomat CS is barfing on tests/TestCase/Command/TemplateCommandTest.php, any idea how to fix/figure out the cause?

EDIT: Figured it out. It blew up because a docblock had @param $name instead of @param string $name.

phpstan decided to change the return type which broke slevomat.

use DirectoryIterator;
use ReflectionClass;
use ReflectionException;

/**
* Plugin class for bake
*/
class Plugin extends BasePlugin
class BakePlugin extends BasePlugin
{
/**
* Plugin name.
*
* @var string
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @var string
* @var string|null

if you meant for this to be nullable

Copy link
Member Author

Choose a reason for hiding this comment

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

I wish we didn't have to add these redundant docblock types anymore :(.

Copy link
Member

Choose a reason for hiding this comment

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

We need to do a test with the slevomat setting that detects redundant blocks. I don't know if it forces all @param annotations to be removed even if there's a description you want to keep. Should we just not have comments on parameters annotations anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we should drop parameter comments but I doubt it would allow param description without the type.

Copy link
Member

Choose a reason for hiding this comment

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

Need to test if a comment prevents it from being marked useless.

Copy link
Member

Choose a reason for hiding this comment

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

I would rather check why the sniffs are missing for it:
https://github.com/spryker/code-sniffer/blob/master/Spryker/Sniffs/Commenting/DocBlockReturnNullSniff.php
or
https://github.com/spryker/code-sniffer/blob/master/Spryker/Sniffs/Commenting/DocBlockReturnNullableTypeSniff.php
could be the right direction here.

As long as they are properly synced, which is easier, all is well.

@othercorey
Copy link
Member

looks good.

@ADmad ADmad merged commit 1f6138e into cake5 Jun 25, 2022
@ADmad ADmad deleted the cake5-updates branch June 25, 2022 20:09
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