From fc9149c1041fbfeb959f7c13068906230946d7f0 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Tue, 17 Nov 2026 12:40:56 +0900 Subject: [PATCH 1/2] Point the attribute docblocks to the manual --- src/Annotation/AuraSql.php | 5 +++++ src/Annotation/AuraSqlQueryConfig.php | 3 +++ src/Annotation/PagerViewOption.php | 5 +++++ src/Annotation/Read.php | 3 +++ src/Annotation/ReadOnlyConnection.php | 6 ++++++ src/Annotation/Transactional.php | 6 ++++++ src/Annotation/WriteConnection.php | 6 ++++++ 7 files changed, 34 insertions(+) diff --git a/src/Annotation/AuraSql.php b/src/Annotation/AuraSql.php index 9b8138d5..a004e436 100644 --- a/src/Annotation/AuraSql.php +++ b/src/Annotation/AuraSql.php @@ -6,6 +6,11 @@ use Attribute; +/** + * Sets the `pdo` property to the read or write connection by the name of the called method + * + * @see \Ray\AuraSqlModule\AuraSqlConnectionInterceptor + */ #[Attribute(Attribute::TARGET_CLASS)] final class AuraSql { diff --git a/src/Annotation/AuraSqlQueryConfig.php b/src/Annotation/AuraSqlQueryConfig.php index d2daf635..a83d0528 100644 --- a/src/Annotation/AuraSqlQueryConfig.php +++ b/src/Annotation/AuraSqlQueryConfig.php @@ -7,6 +7,9 @@ use Attribute; use Ray\Di\Di\Qualifier; +/** + * Qualifies the database type that the Aura.SqlQuery builders are created for + */ #[Attribute(Attribute::TARGET_PARAMETER), Qualifier] final class AuraSqlQueryConfig { diff --git a/src/Annotation/PagerViewOption.php b/src/Annotation/PagerViewOption.php index cddb0adc..4193cfb5 100644 --- a/src/Annotation/PagerViewOption.php +++ b/src/Annotation/PagerViewOption.php @@ -7,6 +7,11 @@ use Attribute; use Ray\Di\Di\Qualifier; +/** + * Qualifies the options passed to the Pagerfanta view that renders the pager HTML + * + * @see https://bearsunday.github.io/manuals/1.0/en/database_aura.html#pagination + */ #[Attribute(Attribute::TARGET_PARAMETER), Qualifier] final class PagerViewOption { diff --git a/src/Annotation/Read.php b/src/Annotation/Read.php index 96c91958..6a58ebf5 100644 --- a/src/Annotation/Read.php +++ b/src/Annotation/Read.php @@ -7,6 +7,9 @@ use Attribute; use Ray\Di\Di\Qualifier; +/** + * Qualifies the names of the methods that use the read connection in an #[AuraSql] class + */ #[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_PARAMETER), Qualifier] final class Read { diff --git a/src/Annotation/ReadOnlyConnection.php b/src/Annotation/ReadOnlyConnection.php index ce656056..11c7f58a 100644 --- a/src/Annotation/ReadOnlyConnection.php +++ b/src/Annotation/ReadOnlyConnection.php @@ -6,6 +6,12 @@ use Attribute; +/** + * Sets the `pdo` property to the read (slave) connection before the method runs + * + * @see https://bearsunday.github.io/manuals/1.0/en/database_aura.html#replication + * @see \Ray\AuraSqlModule\AuraSqlSlaveDbInterceptor + */ #[Attribute(Attribute::TARGET_METHOD)] final class ReadOnlyConnection { diff --git a/src/Annotation/Transactional.php b/src/Annotation/Transactional.php index a31b3b02..13b252c1 100644 --- a/src/Annotation/Transactional.php +++ b/src/Annotation/Transactional.php @@ -6,6 +6,12 @@ use Attribute; +/** + * Runs the method in a database transaction and rolls back when a PDOException is thrown + * + * @see https://bearsunday.github.io/manuals/1.0/en/database_aura.html#transactions + * @see \Ray\AuraSqlModule\TransactionalInterceptor + */ #[Attribute(Attribute::TARGET_METHOD)] final class Transactional { diff --git a/src/Annotation/WriteConnection.php b/src/Annotation/WriteConnection.php index 269c5e75..7ae1931c 100644 --- a/src/Annotation/WriteConnection.php +++ b/src/Annotation/WriteConnection.php @@ -6,6 +6,12 @@ use Attribute; +/** + * Sets the `pdo` property to the write (master) connection before the method runs + * + * @see https://bearsunday.github.io/manuals/1.0/en/database_aura.html#replication + * @see \Ray\AuraSqlModule\AuraSqlMasterDbInterceptor + */ #[Attribute(Attribute::TARGET_METHOD)] final class WriteConnection { From b1a49b4c040d6298ea5d5f782dee0743f926437c Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Tue, 17 Nov 2026 13:36:39 +0900 Subject: [PATCH 2/2] Narrow the connection attribute docblocks to when they apply --- src/Annotation/AuraSql.php | 3 ++- src/Annotation/ReadOnlyConnection.php | 1 + src/Annotation/WriteConnection.php | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Annotation/AuraSql.php b/src/Annotation/AuraSql.php index a004e436..e922db0b 100644 --- a/src/Annotation/AuraSql.php +++ b/src/Annotation/AuraSql.php @@ -7,7 +7,8 @@ use Attribute; /** - * Sets the `pdo` property to the read or write connection by the name of the called method + * Sets the `pdo` property to the read or write connection for the methods + * listed in the read and write method lists of AuraSqlLocatorModule * * @see \Ray\AuraSqlModule\AuraSqlConnectionInterceptor */ diff --git a/src/Annotation/ReadOnlyConnection.php b/src/Annotation/ReadOnlyConnection.php index 11c7f58a..14d05c52 100644 --- a/src/Annotation/ReadOnlyConnection.php +++ b/src/Annotation/ReadOnlyConnection.php @@ -8,6 +8,7 @@ /** * Sets the `pdo` property to the read (slave) connection before the method runs + * when replication is configured (AuraSqlModule without a slave ignores it) * * @see https://bearsunday.github.io/manuals/1.0/en/database_aura.html#replication * @see \Ray\AuraSqlModule\AuraSqlSlaveDbInterceptor diff --git a/src/Annotation/WriteConnection.php b/src/Annotation/WriteConnection.php index 7ae1931c..4c406648 100644 --- a/src/Annotation/WriteConnection.php +++ b/src/Annotation/WriteConnection.php @@ -8,6 +8,7 @@ /** * Sets the `pdo` property to the write (master) connection before the method runs + * when replication is configured (AuraSqlModule without a slave ignores it) * * @see https://bearsunday.github.io/manuals/1.0/en/database_aura.html#replication * @see \Ray\AuraSqlModule\AuraSqlMasterDbInterceptor