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

TCMN-177 Correction to docblocks for where and all methods #2341

Open
wants to merge 2 commits into
base: release/T25.imp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/fix-TCMN-177-correct-ORM-docblocks
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Added more details to `Core_Read_Interface` methods' docblocks to avoid errors in PHPStan. [TCMN-177]
13 changes: 9 additions & 4 deletions src/Tribe/Repository/Core_Read_Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ public function by( $key, $value = null );
/**
* Just an alias of the `by` method to allow for easier reading.
*
* This method can accept additional arguments as individual, comma-separated
* parameters, which will be passed to the schema.
*
* @since 4.7.19
* @since TBD Added clarification about format for optional additional arguments.
*
* @param string $key
* @param mixed $value
* @param string $key The key to query by.
* @param mixed $value The value associated with the key.
*
* @return Tribe__Repository__Read_Interface
*/
Expand Down Expand Up @@ -109,13 +113,14 @@ public function found();
*
* @since 4.1.3
* @since 5.2.0 Added the `$return_generator` and `$batch_size` parameters.
* @since TBD Updated `return` to more accurately reflect what can be returned.
*
* @param bool $return_generator Whether to return a generator of post IDs instead of an array of post IDs.
* @param int $batch_size The number of post IDs to fetch at a time when using a generator; ignored
* if `$return_generator` is false.
*
* @return array<int>|Generator<int> An array of all the matching post IDs, or a generator of them
* if `$return_generator` is true.
* @return array<int|WP_Post|object>|Generator<int|WP_Post|object> An array of all the matching post IDs, or a generator of them
* if `$return_generator` is true.
*/
public function all( $return_generator = false, int $batch_size = 50 );

Expand Down
Loading