Files
pdo-document/src/Mapper/CountMapper.php
T
danieljsummers d8330d828a Derive mode from DSN function
- Add headers in all files
- Minor field name changes
2024-07-20 21:47:21 -04:00

22 lines
392 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
*/
class CountMapper implements Mapper
{
/** @inheritDoc */
public function map(array $result): int
{
return (int) $result[0];
}
}