mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 17:41:50 +01:00
Collection/storage of templates
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Meritoo\Common\Exception\ValueObject\Template;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* An exception used while template with given index was not found
|
||||
*
|
||||
* @author Meritoo <github@meritoo.pl>
|
||||
* @copyright Meritoo <http://www.meritoo.pl>
|
||||
*/
|
||||
class TemplateNotFoundException extends Exception
|
||||
{
|
||||
/**
|
||||
* Creates the exception
|
||||
*
|
||||
* @param string $index Index that should contain template, but it was not found
|
||||
* @return TemplateNotFoundException
|
||||
*/
|
||||
public static function create(string $index): TemplateNotFoundException
|
||||
{
|
||||
$template = 'Template with \'%s\' index was not found. Did you provide all required templates?';
|
||||
$message = sprintf($template, $index);
|
||||
|
||||
return new static($message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user