-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
IncorrectValueInAttributeException
- Loading branch information
1 parent
4d678b6
commit 5334f87
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2024 Saxon State and University Library Dresden | ||
* | ||
* This file is part of the php-mods-reader. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Slub\Mods\Exception; | ||
|
||
use Exception; | ||
use Throwable; | ||
|
||
class IncorrectValueInAttributeException extends Exception { | ||
|
||
/** | ||
* Constructor for the custom exception. | ||
* | ||
* @param string $attribute name of the attribute | ||
* @param string $value not allowed value | ||
* @param integer $code | ||
* @param Throwable|null $previous | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(string $attribute, string $value, int $code = 0, Throwable $previous = null) { | ||
$message = 'Value "' . $value . '" is not allowed for attribute "' . $attribute . '".'; | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |