fatcode/hydration

View on GitHub
src/Type/IntegerType.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php declare(strict_types=1);

namespace FatCode\Hydration\Type;

class IntegerType implements Type, NullableType
{
    use Nullable;
    
    public function hydrate($value): int
    {
        return (int) $value;
    }

    public function extract($value): int
    {
        return (int) $value;
    }
}