Skip to content

[Console] CS fix #53363

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

Merged
merged 1 commit into from
Jan 4, 2024
Merged

[Console] CS fix #53363

merged 1 commit into from
Jan 4, 2024

Conversation

OskarStark
Copy link
Contributor

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues --
License MIT

@@ -53,7 +53,7 @@ public static function fromString(string $inputStr, int $currentIndex): self
* Create an input based on an COMP_WORDS token list.
*
* @param string[] $tokens the set of split tokens (e.g. COMP_WORDS or argv)
* @param $currentIndex the index of the cursor (e.g. COMP_CWORD)
* @param int $currentIndex the index of the cursor (e.g. COMP_CWORD)
Copy link
Member

@wouterj wouterj Jan 2, 2024

Choose a reason for hiding this comment

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

This is intentional. The type is optional and already given in de PHP code. We've done this in multiple locations (and I would even be in favor of removing all duplicate types from the PHPdoc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PHPStorm was complaining about it:
CleanShot 2024-01-03 at 14 43 40@2x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should be content, in 5.4 only two more needs to be fixed, which I've done in this PR.
I also created a PR for 6.3

If both are accepted and (up)merged, I will check 6.4, 7.0 and 7.1

Copy link
Member

Choose a reason for hiding this comment

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

To me, that's a bug in PHPstorm.

Copy link
Member

Choose a reason for hiding this comment

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

@wouterj Do you have a link to a discussion about this?
I consider such doc param to be incomplete and less readable: when reading a param's description, not having the type right before it requires to find and look at the corresponding parameter inside the signature to get the full picture

Copy link
Member

@wouterj wouterj Jan 3, 2024

Choose a reason for hiding this comment

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

Sure, it has always been part of our coding standard:

  • Add PHPDoc blocks for classes, methods, and functions only when they add relevant information that does not duplicate the name, native type declaration or context (e.g. instanceof checks);

Discussed in the PR making the change: #41912 (review)

See also #46140 #46218 #46217 #44935 #45324 (a couple of these are rejected by you actually Robin 😉)

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough :)

@OskarStark OskarStark changed the title [Console] Add missing PHPDoc type [Console][Cache] Add missing PHPDoc type Jan 3, 2024
@carsonbot carsonbot changed the title [Console][Cache] Add missing PHPDoc type [Cache][Console] Add missing PHPDoc type Jan 3, 2024
@@ -92,9 +92,6 @@ public function prune()
return $pruned;
}

/**
* {@inheritdoc}
*/
Copy link
Contributor Author

@OskarStark OskarStark Jan 3, 2024

Choose a reason for hiding this comment

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

Those "inheritdoc" got removed by applying the fabbot patch, shall I revert?

Copy link
Member

Choose a reason for hiding this comment

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

any value to keep it? i would suggest to remove all.
and if anything, I would suggest to switch to #[Override] (probably as alignment for whole project, not this single place only)

@@ -129,8 +129,6 @@ public function advance()

/**
* Finish the indicator with message.
*
* @param $message
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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 think that's the only change we might wanna keep. See @wouterj's comment.
Also 5.4 is for bug fixes only, and this is not one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@nicolas-grekas nicolas-grekas changed the title [Cache][Console] Add missing PHPDoc type [Console] CS fix Jan 4, 2024
@nicolas-grekas
Copy link
Member

Thank you @OskarStark.

@nicolas-grekas nicolas-grekas merged commit 14c9476 into symfony:5.4 Jan 4, 2024
@OskarStark OskarStark deleted the fix/doc branch January 4, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants