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

Improving phpDoc #3635

Merged
merged 1 commit into from
Sep 22, 2023
Merged

Conversation

renatonascalves
Copy link
Contributor

@renatonascalves renatonascalves commented Sep 6, 2023

Description of the Change

phpDoc improvements.

How to test the Change

You can run phpstan in the project and confirm the errors.

Changelog Entry

Changed - Updated phpDoc entries.

Credits

@renatonascalves

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@@ -49,7 +48,7 @@ abstract class Indexable {
* Instance of QueryIntegration. This should handle integrating with a default
* WP query.
*
* @var QueryIntegration
* @var object
Copy link
Contributor Author

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
Copy link
Contributor Author

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.
Copy link
Contributor Author

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.  

@renatonascalves renatonascalves marked this pull request as ready for review September 6, 2023 14:13
@felipeelia felipeelia added this to the 5.0.0 milestone Sep 6, 2023
@felipeelia felipeelia modified the milestones: 5.0.0, 4.7.2 Sep 22, 2023
@felipeelia felipeelia merged commit 1bbade9 into 10up:develop Sep 22, 2023
7 of 9 checks passed
@renatonascalves renatonascalves deleted the feature/phpdoc-suggestions branch September 22, 2023 14:44
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