Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
PrefixNotFoundException
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 forId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Core\Engine\Domain\Exception;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use RuntimeException;
12
13/**
14 * Exception thrown when a requested prefix record is not found in repository.
15 *
16 * @package App\Core\Engine\Domain\Exception
17 */
18final class PrefixNotFoundException extends RuntimeException
19{
20    /**
21     * Creates exception for a missing prefix record ID.
22     *
23     * @param int $prefixId Missing prefix record ID.
24     * @return self New exception instance.
25     */
26    public static function forId(int $prefixId): self
27    {
28        return new self(sprintf('Prefix configuration ID %d not found.', $prefixId));
29    }
30}