Implement level 6 PHPStan fixes

This commit is contained in:
2024-08-27 23:30:05 -04:00
parent 4d764cbb3f
commit 15ff5d3cb6
37 changed files with 239 additions and 168 deletions

View File

@@ -10,6 +10,8 @@ namespace BitBadger\PDODocument\Mapper;
/**
* A mapper that returns the associative array from the database
*
* @implements Mapper<array<int|string, mixed>>
*/
class ArrayMapper implements Mapper
{

View File

@@ -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
{

View File

@@ -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<int|string, 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
*/

View File

@@ -13,6 +13,8 @@ use Exception;
/**
* Map an EXISTS result to a boolean value
*
* @implements Mapper<bool>
*/
class ExistsMapper implements Mapper
{

View File

@@ -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<int|string, 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;