diff --git a/src/Annotation/DbQuery.php b/src/Annotation/DbQuery.php index 7224092..27bdcf7 100644 --- a/src/Annotation/DbQuery.php +++ b/src/Annotation/DbQuery.php @@ -6,10 +6,20 @@ use Attribute; +/** + * Runs the SQL file of the ID with the method arguments and returns the result + * + * @see https://bearsunday.github.io/manuals/1.0/en/database_media.html#dbquery + * @see \Ray\MediaQuery\DbQueryInterceptor + */ #[Attribute(Attribute::TARGET_METHOD)] final class DbQuery { - /** @param 'row'|'row_list' $type */ + /** + * @param string $id SQL file name in the SQL directory, without `.sql` + * @param 'row'|'row_list' $type `row` returns a single row for an `array` return type + * @param string $factory Class whose factory method creates each row + */ public function __construct( public string $id, public string $type = 'row_list', diff --git a/src/Annotation/Pager.php b/src/Annotation/Pager.php index b52aa0b..903393a 100644 --- a/src/Annotation/Pager.php +++ b/src/Annotation/Pager.php @@ -6,10 +6,18 @@ use Attribute; +/** + * Paginates the #[DbQuery] result into a lazily queried PagesInterface + * + * @see https://bearsunday.github.io/manuals/1.0/en/database_media.html#pagination + */ #[Attribute(Attribute::TARGET_METHOD)] final class Pager { - /** @param int|string $perPage int:the number of items, string: the name of the argument of the number of items */ + /** + * @param int|string $perPage int:the number of items, string: the name of the argument of the number of items + * @param string $template URI template of the page links in the pager HTML + */ public function __construct( public int|string $perPage = 10, public string $template = '/{?page}', diff --git a/src/Annotation/Qualifier/FactoryMethod.php b/src/Annotation/Qualifier/FactoryMethod.php index e2afc02..ded496a 100644 --- a/src/Annotation/Qualifier/FactoryMethod.php +++ b/src/Annotation/Qualifier/FactoryMethod.php @@ -7,6 +7,9 @@ use Attribute; use Ray\Di\Di\Qualifier; +/** + * Qualifies the name of the method called on the `factory` class of #[DbQuery] + */ #[Attribute(Attribute::TARGET_PARAMETER)] #[Qualifier] final class FactoryMethod diff --git a/src/Annotation/Qualifier/SqlDir.php b/src/Annotation/Qualifier/SqlDir.php index a968855..36f9cd2 100644 --- a/src/Annotation/Qualifier/SqlDir.php +++ b/src/Annotation/Qualifier/SqlDir.php @@ -7,6 +7,9 @@ use Attribute; use Ray\Di\Di\Qualifier; +/** + * Qualifies the path of the directory that holds the SQL files + */ #[Attribute(Attribute::TARGET_PARAMETER)] #[Qualifier] final class SqlDir