-
-
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
Showing
4 changed files
with
86 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# CHANGELOG | ||
|
||
## 0.5.6 | ||
|
||
* fix: Improve exception message. | ||
|
||
## 0.5.5 | ||
|
||
* docs: Add link to documentation website. | ||
|
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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of rekalogika/mapper package. | ||
* | ||
* (c) Priyadi Iman Nurcahyo <https://rekalogika.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE file | ||
* that was distributed with this source code. | ||
*/ | ||
|
||
namespace Rekalogika\Mapper\Transformer\Exception; | ||
|
||
class UnableToReadException extends NotMappableValueException | ||
{ | ||
public function __construct( | ||
mixed $source, | ||
mixed $target, | ||
mixed $object, | ||
string $propertyName, | ||
\Throwable $previous = null | ||
) { | ||
parent::__construct( | ||
sprintf( | ||
'Trying to map source type "%s" to target type "%s", but encountered an error when trying to read from the property "%s" on object type "%s".', | ||
\get_debug_type($source), | ||
\get_debug_type($target), | ||
$propertyName, | ||
\get_debug_type($object) | ||
), | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of rekalogika/mapper package. | ||
* | ||
* (c) Priyadi Iman Nurcahyo <https://rekalogika.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE file | ||
* that was distributed with this source code. | ||
*/ | ||
|
||
namespace Rekalogika\Mapper\Transformer\Exception; | ||
|
||
class UnableToWriteException extends NotMappableValueException | ||
{ | ||
public function __construct( | ||
mixed $source, | ||
mixed $target, | ||
mixed $object, | ||
string $propertyName, | ||
\Throwable $previous = null | ||
) { | ||
parent::__construct( | ||
sprintf( | ||
'Trying to map source type "%s" to target type "%s", but encountered an error when trying to write to the property "%s" on object type "%s".', | ||
\get_debug_type($source), | ||
\get_debug_type($target), | ||
$propertyName, | ||
\get_debug_type($object) | ||
), | ||
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