-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c17758d
commit 974a982
Showing
11 changed files
with
65 additions
and
9 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
2 changes: 1 addition & 1 deletion
2
src/AttributeNotQueryableException.php → ...ptions/AttributeNotQueryableException.php
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
2 changes: 1 addition & 1 deletion
2
src/DuplicateKeyException.php → src/Exceptions/DuplicateKeyException.php
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
2 changes: 1 addition & 1 deletion
2
src/InvalidKeyException.php → src/Exceptions/InvalidKeyException.php
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,22 @@ | ||
<?php | ||
|
||
namespace DirectoryTree\ActiveRedis\Exceptions; | ||
|
||
use RuntimeException; | ||
|
||
class JsonEncodingException extends RuntimeException | ||
{ | ||
/** | ||
* Create a new JSON encoding exception for an attribute. | ||
* | ||
* @param mixed $model | ||
* @param mixed $key | ||
* @return static | ||
*/ | ||
public static function forAttribute(string $model, string $key, string $message) | ||
{ | ||
$class = get_class($model); | ||
|
||
return new static("Unable to encode attribute [{$key}] for model [{$class}] to JSON: {$message}."); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/ModelNotFoundException.php → src/Exceptions/ModelNotFoundException.php
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
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,13 @@ | ||
<?php | ||
|
||
namespace DirectoryTree\ActiveRedis\Tests\Fixtures; | ||
|
||
use DirectoryTree\ActiveRedis\Model; | ||
|
||
class ModelStubWithCasts extends Model | ||
{ | ||
protected array $casts = [ | ||
'date' => 'date', | ||
'datetime' => 'datetime', | ||
]; | ||
} |
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