- Add In/InArray support - Add ORDER BY support for `Find` functions - Update dependencies - Implement fixes identified via static analysis Reviewed-on: #5
24 lines
422 B
PHP
24 lines
422 B
PHP
<?php
|
|
/**
|
|
* @author Daniel J. Summers <daniel@bitbadger.solutions>
|
|
* @license MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
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
|
|
{
|
|
/** @inheritDoc */
|
|
public function map(array $result): int
|
|
{
|
|
return (int) $result[0];
|
|
}
|
|
}
|