pdo-document/src/Mapper/CountMapper.php
Daniel J. Summers d067f8983f 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
2024-09-27 02:15:00 +00:00

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];
}
}