Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new exception and updated tests to ensure 100% coverage
- Loading branch information
Showing
6 changed files
with
72 additions
and
41 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
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
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,40 @@ | ||
<?php | ||
|
||
/** | ||
* Settings Manager | ||
* | ||
* @license http://opensource.org/licenses/MIT | ||
* @link https://github.com/caseyamcl/settings-manager | ||
* @package caseyamcl/settings-manager | ||
* @author Casey McLaughlin <caseyamcl@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* ------------------------------------------------------------------ | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SettingsManager\Exception; | ||
|
||
use RuntimeException; | ||
use Throwable; | ||
|
||
/** | ||
* Class SettingDefinitionNotFoundException | ||
* | ||
* @author Casey McLaughlin <caseyamcl@gmail.com> | ||
*/ | ||
class SettingDefinitionNotFoundException extends RuntimeException implements SettingException | ||
{ | ||
/** | ||
* @param string $name | ||
* @param Throwable|null $previous | ||
* @return static | ||
*/ | ||
public static function forSetting(string $name, Throwable $previous = null): self | ||
{ | ||
return new static("Setting definition not found: " . $name, 0, $previous); | ||
} | ||
} |
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
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
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