soliantconsulting/SimpleFM

View on GitHub
src/Client/ResultSet/Transformer/Exception/DateTimeException.php

Summary

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

namespace Soliant\SimpleFM\Client\ResultSet\Transformer\Exception;

use DomainException;

final class DateTimeException extends DomainException implements ExceptionInterface
{
    public static function fromDateTimeError(string $value, array $lastErrors) : self
    {
        return new self(sprintf('Could not parse "%s", reason: %s', $value, $lastErrors['errors'][0]));
    }
}