Add docs link, misc format tweaks

This commit is contained in:
2024-07-21 22:02:16 -04:00
parent d8330d828a
commit 0659de3f99
16 changed files with 49 additions and 48 deletions

View File

@@ -21,8 +21,8 @@ use PDOStatement;
*/
class DocumentList
{
/** @var TDoc|null $_first The first item from the results */
private mixed $_first = null;
/** @var TDoc|null $first The first item from the results */
private mixed $first = null;
/**
* Constructor
@@ -33,7 +33,7 @@ class DocumentList
private function __construct(private ?PDOStatement &$result, private readonly Mapper $mapper)
{
if ($row = $this->result->fetch(PDO::FETCH_ASSOC)) {
$this->_first = $this->mapper->map($row);
$this->first = $this->mapper->map($row);
} else {
$this->result = null;
}
@@ -62,7 +62,7 @@ class DocumentList
public function items(): Generator
{
if (!$this->result) return;
yield $this->_first;
yield $this->first;
while ($row = $this->result->fetch(PDO::FETCH_ASSOC)) {
yield $this->mapper->map($row);
}