-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
php short classpaths and allow null #89
Comments
together with php-cs-fixer I already solved |
DoGe will convert the function type to its FQN unless it's an alias. I know there's some discussion around this. Drupal and Magento both highly prefer to use its FQN for better readability and clarity which I highly agree on. Drupal: https://www.drupal.org/docs/develop/standards/api-documentation-and-comment-standards#types The majority seems to use this so hence I respected the majorities decision.
I'll put this one on my list. I know some folks prefer this, but not me.
I'll put this one on my listas well. |
But the part with ?Project -> Project|null is not working For other thing I can't agree because it is politics of company. But maybe you can suggest how to change FQCN in vim, maybe rewrite some function? |
I did (mostly copied from php.vim) own template and removed all TODO parts (slots to add docs) because we don't use that. And maybe I can add something here to have short classpaths |
Oh, I didn't see the question mark indicator. I will put it on the list then as well. easy to do this one. Which PHP version did support this?
What do you mean here? And what is FQCN?
Then what's the point in adding a docblock if you only have DoGe is made for what the majority of developers use and TODO's are being filled in by most devs, and obviously people should document things.
You can't unless you work around DoGe in quite an inconvenient way. I'll add this to my list to add support for language specific configuration. |
From 7.1 https://www.php.net/manual/en/migration71.new-features.php
Full Qualified Class Name :) /a/b/c/ClassName -> ClassName.
as I said this is politic to have docblocks on all methods. If type is not declared in method then I have [TODO] for param but descriptions are needless. I you need to add it it means your method name is wrong. It's philosofy :D |
In a lot of scenario's this can be the case, yes, but there are moments where a simple parameter name can't describe its purpose. Unless you make an insanely long parameter name, keeping the name more short and adding additional explanation is much better and used by almost any dev. This is the exact reason why we docblocks, so that we don't need super long parameter names that should exactly describe what it's being used for inside that function. |
The link you mentioned is mentioning the following possibilities: public function foo(Foo|null $foo): void;
public function bar(?Bar $bar): void; Right now this is already possible using the |
I did add a configurable |
@zordsdavini Could you check the empty line I've added + the new |
@kkoomen you are awesome :) |
I presume you're referring to https://docs.phpdoc.org/latest/guides/types.html#multiple-types-combined? It doesn't specifically states that |
@zordsdavini Besides the parameter alignment, all your suggestions have been resolved. I don't think the parameter alignment will be in there because it requires quite a lot of work and I don't have that right now. I'll close this for now. Feel free to open new issues with ideas or unwanted behavior. These features have been merged and released in v2.5.0. Feel free to submit any new issues if you experience any unwanted behavior in the future. Thanks for your contribution. |
for param types this works grate, but for return type sadly nope :-/ |
How to make in phpdoc params not in full class path?
Example DoGe generates:
But I want to get it:
because Project is already imported (
use App\Entity\Project;
)Thanks for help ;)
The text was updated successfully, but these errors were encountered: