Add docs link, misc format tweaks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user