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

Add PhpStorm metadata file for service() #5289

Closed
wants to merge 1 commit into from

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Nov 6, 2021

Description

  • to autocomplete service()

Screenshot 2021-11-06 11 06 22

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • [] Conforms to style guide

@MGatner
Copy link
Member

MGatner commented Nov 6, 2021

How important is it for this to be in the same repo? We've talked about creating a "tools" or "devkit" library for supplemental content like this.

@kenjis
Copy link
Member Author

kenjis commented Nov 6, 2021

Good point. The file does not need to be in this repo.

@MGatner
Copy link
Member

MGatner commented Nov 7, 2021

I will launch a toolkit repo soon and have you direct this over there.

@MGatner
Copy link
Member

MGatner commented Nov 16, 2021

@kenjis This is safe to move to https://github.com/codeigniter4/devkit - even though we don't have a release someone could use a VCS entry to include the file.

BTW do you know of a way to accomplish this same information for PHPStan? I read up on stub files but they don't seem to support "this parameter => this outcome" sort of notation that we would need. I am constantly adding inline comments for helper functions like model() and service() and it would be nice to be able to define those centrally.

@kenjis
Copy link
Member Author

kenjis commented Nov 19, 2021

@MGatner
Factories::models() uses __callStatic(), so probably PHPStan extensions are needed.
https://phpstan.org/developing-extensions/class-reflection-extensions#methods-class-reflection-extensions

But the documentation is too little. I don't get how to write them.

@MGatner
Copy link
Member

MGatner commented Nov 19, 2021

@kenjis I actually asked about this (phpstan/phpstan#6019) and think I have a path to a solution.

@kenjis
Copy link
Member Author

kenjis commented Nov 19, 2021

@MGatner How about this #5358 ?

@kenjis kenjis marked this pull request as draft November 23, 2021 04:28
@kenjis kenjis closed this Jan 21, 2022
@kenjis kenjis deleted the add-phpstorm.meta.php branch February 18, 2022 01:51
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.

2 participants