diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-01-17 02:11:31 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-01-17 02:11:31 +0900 |
| commit | deacd0dfc195bca41af631114804d29937337cd8 (patch) | |
| tree | f1f83580e5bc892c0794ac41632bc0cce3498f65 /services/app/src/Sql/Internal/SelectFirst.php | |
| parent | 38ddeb28ec846ee966d0fe6873585d697a9ef373 (diff) | |
| download | phperkaigi-2024-albatross-deacd0dfc195bca41af631114804d29937337cd8.tar.gz phperkaigi-2024-albatross-deacd0dfc195bca41af631114804d29937337cd8.tar.zst phperkaigi-2024-albatross-deacd0dfc195bca41af631114804d29937337cd8.zip | |
.
Diffstat (limited to 'services/app/src/Sql/Internal/SelectFirst.php')
| -rw-r--r-- | services/app/src/Sql/Internal/SelectFirst.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/services/app/src/Sql/Internal/SelectFirst.php b/services/app/src/Sql/Internal/SelectFirst.php new file mode 100644 index 0000000..baf5aae --- /dev/null +++ b/services/app/src/Sql/Internal/SelectFirst.php @@ -0,0 +1,26 @@ +<?php + +declare(strict_types=1); + +namespace Nsfisis\Albatross\Sql\Internal; + +/** + * @internal + */ +final class SelectFirst +{ + public function __construct( + private readonly Select $inner, + ) { + } + + /** + * @param array<string, string|int> $params + * @return ?array<string, string> + */ + public function execute(array $params = []): ?array + { + $result = $this->inner->execute($params); + return $result[0] ?? null; + } +} |
