-
Notifications
You must be signed in to change notification settings - Fork 13
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
IBX-4929: ContentService: Fix @see usage #219
Conversation
For phpDocumentor 3.3.1 - the parenthesis are mandatory for the reference to be seen as a function - the className shouldn't but seems mandatory too.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parenthesis are mandatory for the reference to be seen as a function.
This is bad. It's semantically wrong from the software engineering point of view. You're referencing a method, not its call. If there's no way to work around it, maybe we should drop this arcane tool?
@alongosz, I agree with the semantic problem. The parenthesis are not part of the method name. phpDocumentor use From my POV, this ugly convention might come from PHP itself. class Test
{
public const sameName = 'constant';
public static function sameName()
{
return func_get_args();
}
}
var_dump(Test::sameName, Test::sameName('method'));
$v='Test::sameName';
var_dump(constant($v), $v('method')); In this example, From my POV, this parenthesis convention is acceptable. About alternatives to phpDocumentor, I haven't test much yet (there isn't much alternatives anyway).
I'm looking for others. For now, phpDocumentor is the easiest to use with automation, the easiest to stylize, with a look & feel similar to the REST API Reference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @alongosz about the semantic meaning, but given that it is our tool of choice and the "impact" of the change is minimal, I'm ok with it 😅
@adriendupuis Since we've agreed to use phpDoc in the past we need to comply with its syntax and not argue wether it's correct or not. I believe we may have issues like this in many more places. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my POV, this ugly convention might come from PHP itself.
PHP doesn't see Class::method as a reference to a method and will look for a constant.
You can't write something like $m=MyClass::staticMethod; $m();.
This is very good argument 👍
Thank you @adriendupuis 🎉 |
v4.0
Fix
@see
usage for phpDocumentor 3.3.1Checklist:
$ composer fix-cs
).@ibexa/engineering
).