generated from yiisoft/package-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and rename
InvalidAttributeException
to `UndefinedProperty…
…Exception` (#270)
- Loading branch information
Showing
6 changed files
with
52 additions
and
49 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 was deleted.
Oops, something went wrong.
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,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Form; | ||
|
||
use InvalidArgumentException; | ||
|
||
final class UndefinedPropertyException extends InvalidArgumentException | ||
{ | ||
private function __construct(string $message) | ||
{ | ||
parent::__construct($message); | ||
} | ||
|
||
public static function forUndefinedProperty(string $property): self | ||
{ | ||
return new self('Undefined property: "' . $property . '".'); | ||
} | ||
|
||
public static function forNotNestedProperty(string $property): self | ||
{ | ||
return new self('Property "' . $property . '" is not a nested attribute.'); | ||
} | ||
} |
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