-
-
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.
feat:
Map(property: null)
ignores the mapping (#239)
- Loading branch information
Showing
10 changed files
with
206 additions
and
14 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
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
38 changes: 38 additions & 0 deletions
38
tests/src/Fixtures/MapAttribute/SomeObjectSkippingMapping.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?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\Tests\Fixtures\MapAttribute; | ||
|
||
use Rekalogika\Mapper\Attribute\Map; | ||
|
||
class SomeObjectSkippingMapping | ||
{ | ||
#[Map(property: null)] | ||
public ?string $sourcePropertyA = null; | ||
|
||
#[Map(property: null)] | ||
public ?string $sourcePropertyB = null; | ||
|
||
#[Map(property: null)] | ||
public ?string $sourcePropertyC = null; | ||
|
||
public static function preinitialized(): self | ||
{ | ||
$object = new self(); | ||
$object->sourcePropertyA = 'sourcePropertyA'; | ||
$object->sourcePropertyB = 'sourcePropertyB'; | ||
$object->sourcePropertyC = 'sourcePropertyC'; | ||
|
||
return $object; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/src/Fixtures/MapAttribute/SomeObjectSkippingMappingDto.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?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\Tests\Fixtures\MapAttribute; | ||
|
||
use Rekalogika\Mapper\Attribute\Map; | ||
|
||
class SomeObjectSkippingMappingDto | ||
{ | ||
#[Map(property: null)] | ||
public ?string $sourcePropertyA = null; | ||
|
||
#[Map(property: null)] | ||
public ?string $sourcePropertyB = null; | ||
|
||
#[Map(property: null)] | ||
public ?string $sourcePropertyC = null; | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
tests/src/Fixtures/MapAttribute/SomeObjectWithSamePropertyNameDto.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?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\Tests\Fixtures\MapAttribute; | ||
|
||
class SomeObjectWithSamePropertyNameDto | ||
{ | ||
public ?string $sourcePropertyA = null; | ||
|
||
public ?string $sourcePropertyB = null; | ||
|
||
public ?string $sourcePropertyC = null; | ||
|
||
} |
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