tuupola / slim-api-skeleton

Compare 0e689f0 ... +1 ... bc4340e


@@ -17,19 +17,18 @@
Loading
17 17
namespace Skeleton\Application\Todo;
18 18
19 19
use Skeleton\Domain\TodoUid;
20 -
use Zend\Hydrator\HydratorInterface;
21 -
use Zend\Hydrator\Reflection as ReflectionHydrator;
22 -
use Zend\Hydrator\NamingStrategy\MapNamingStrategy;
23 -
use Zend\Hydrator\Strategy\DateTimeFormatterStrategy;
24 -
use Zend\Hydrator\Strategy\BooleanStrategy;
25 -
use Zend\Hydrator\Strategy\ClosureStrategy;
20 +
use Laminas\Hydrator\HydratorInterface;
21 +
use Laminas\Hydrator\ReflectionHydrator;
22 +
use Laminas\Hydrator\NamingStrategy\MapNamingStrategy;
23 +
use Laminas\Hydrator\Strategy\DateTimeFormatterStrategy;
24 +
use Laminas\Hydrator\Strategy\ClosureStrategy;
26 25
27 26
class TodoHydratorFactory
28 27
{
29 28
    public function create(): HydratorInterface
30 29
    {
31 30
        $hydrator = new ReflectionHydrator;
32 -
        $hydrator->setNamingStrategy(new MapNamingStrategy([
31 +
        $hydrator->setNamingStrategy(MapNamingStrategy::createFromHydrationMap([
33 32
            "created_at" => "createdAt",
34 33
            "updated_at" => "updatedAt",
35 34
        ]));
@@ -59,8 +58,8 @@
Loading
59 58
                function (TodoUid $uid) {
60 59
                    return (string) $uid;
61 60
                },
62 -
                function (string $uid) {
63 -
                    return new TodoUid($uid);
61 +
                function ($uid) {
62 +
                    return new TodoUid((string)$uid);
64 63
                }
65 64
            )
66 65
        );
@@ -71,7 +70,7 @@
Loading
71 70
                function (int $order) {
72 71
                    return $order;
73 72
                },
74 -
                function (string $order) {
73 +
                function ($order) {
75 74
                    return (int) $order;
76 75
                }
77 76
            )

Learn more Showing 3 files with coverage changes found.

Changes in src/Infrastructure/ZendTodoRepository.php
+3
Loading file...
Changes in src/Application/Todo/TodoHydratorFactory.php
+2
Loading file...
New file src/Domain/TodoRepository.php
New
Loading file...
Files Complexity Coverage
src ø -1.07% 98.65%
Project Totals (30 files) 101 98.65%
Loading