-
Notifications
You must be signed in to change notification settings - Fork 313
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
Improving phpDoc #3635
Improving phpDoc #3635
Conversation
@@ -49,7 +48,7 @@ abstract class Indexable { | |||
* Instance of QueryIntegration. This should handle integrating with a default | |||
* WP query. | |||
* | |||
* @var QueryIntegration | |||
* @var object |
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.
None of the core features extends this class. So this object here is incorrect.
One gets this error while extending the class.
Property ElasticPress\Indexable::$query_integration (ElasticPress\QueryIntegration) does not accept Project\QueryIntegration.
```
@@ -152,7 +152,7 @@ public function get_all( $global = null, $slug_only = false, $status = 'active' | |||
/** | |||
* Return singleton instance of class | |||
* | |||
* @return object | |||
* @return self |
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.
Intellisense tools will make better use of this with self
. Currently, one gets this:
Call to an undefined method object::get().
* @since 3.1.2 | ||
* @since 3.1.2 | ||
* | ||
* @param int $object_id Object ID to sync. |
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.
Fixes this error:
Parameter #1 $object_id of method ElasticPress\SyncManager::add_to_queue() expects ElasticPress\id, int given.
Description of the Change
phpDoc improvements.
How to test the Change
You can run phpstan in the project and confirm the errors.
Changelog Entry
Credits
@renatonascalves
Checklist: