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

@@ -26,7 +26,7 @@ class DocumentMapper implements Mapper
* @param class-string<TDoc> $className The type of class to be returned by this mapping
* @param string $fieldName The name of the field (optional; defaults to `data`)
*/
public function __construct(public string $className, public string $fieldName = 'data') { }
public function __construct(public string $className, public string $fieldName = 'data') {}
/**
* Map a result to a domain class instance

View File

@@ -24,7 +24,7 @@ class ExistsMapper implements Mapper
{
return match (Configuration::mode('map existence result')) {
Mode::PgSQL => (bool)$result[0],
Mode::SQLite => (int)$result[0] > 0
Mode::SQLite => (int)$result[0] > 0,
};
}
}

View File

@@ -30,7 +30,7 @@ class StringMapper implements Mapper
return match (false) {
key_exists($this->fieldName, $result) => null,
is_string($result[$this->fieldName]) => "{$result[$this->fieldName]}",
default => $result[$this->fieldName]
default => $result[$this->fieldName],
};
}
}