PhpStorm - Add IDE hints for civicrm_api4()
$entity
and $action
params
#27171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Builds on @totten's work in #27168 to add IDE type hints for the
civicrm_api4()
function.Before
No hints
After
Technical Details
Also simplifies the
ConformanceTest::getEntitiesLoTech
method.@totten when I was working on this I noticed a couple oddities. I had to use a lo-tech way of gathering entity names because the container hasn't been built by the time this is called. I wonder if that's actually necessary? Because the other oddity I noticed is that the list of services in
.phpstorm.meta.php
is incomplete. It doesn't include theaction_object_provider
service for example (which is the one we'd use for gathering APIv4 entities).Seems like the ideal time for
Civi\PhpStorm\Generator
to run would be just after the container is built. Then it wouldn't be missing any services, and could actually make use of them without crashing.