Changes for beta10 (#5)
- Add In/InArray support - Add ORDER BY support for `Find` functions - Update dependencies - Implement fixes identified via static analysis Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
@@ -10,10 +10,15 @@ namespace BitBadger\PDODocument\Mapper;
|
||||
|
||||
/**
|
||||
* A mapper that returns the associative array from the database
|
||||
*
|
||||
* @implements Mapper<array<string|int, mixed>>
|
||||
*/
|
||||
class ArrayMapper implements Mapper
|
||||
{
|
||||
/** @inheritDoc */
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @return array<string|int, mixed> The array given as the parameter
|
||||
*/
|
||||
public function map(array $result): array
|
||||
{
|
||||
return $result;
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace BitBadger\PDODocument\Mapper;
|
||||
|
||||
/**
|
||||
* A mapper that returns the integer value of the first item in the results
|
||||
*
|
||||
* @implements Mapper<int>
|
||||
*/
|
||||
class CountMapper implements Mapper
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ class DocumentMapper implements Mapper
|
||||
/**
|
||||
* Map a result to a domain class instance
|
||||
*
|
||||
* @param array $result An associative array representing a single database result
|
||||
* @param array<string|int, mixed> $result An associative array representing a single database result
|
||||
* @return TDoc The document, deserialized from its JSON representation
|
||||
* @throws DocumentException If the JSON cannot be deserialized
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,8 @@ use Exception;
|
||||
|
||||
/**
|
||||
* Map an EXISTS result to a boolean value
|
||||
*
|
||||
* @implements Mapper<bool>
|
||||
*/
|
||||
class ExistsMapper implements Mapper
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ interface Mapper
|
||||
/**
|
||||
* Map a result to the specified type
|
||||
*
|
||||
* @param array $result An associative array representing a single database result
|
||||
* @param array<string|int, mixed> $result An associative array representing a single database result
|
||||
* @return T The item mapped from the given result
|
||||
*/
|
||||
public function map(array $result): mixed;
|
||||
|
||||
Reference in New Issue
Block a user