-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reproducer issue with constructor models no isset check
- Loading branch information
Showing
54 changed files
with
823 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
use AutoMapper\Tests\Fixtures\ClassWithMapToContextAttribute; | ||
use AutoMapper\Tests\Fixtures\ClassWithNullablePropertyInConstructor; | ||
use AutoMapper\Tests\Fixtures\ClassWithPrivateProperty; | ||
use AutoMapper\Tests\Fixtures\ComposeModels\Compose; | ||
use AutoMapper\Tests\Fixtures\ConstructorWithDefaultValues; | ||
use AutoMapper\Tests\Fixtures\DifferentSetterGetterType; | ||
use AutoMapper\Tests\Fixtures\Dog; | ||
|
@@ -64,6 +65,7 @@ | |
use Symfony\Component\Serializer\NameConverter\AdvancedNameConverterInterface; | ||
use Symfony\Component\Uid\Ulid; | ||
use Symfony\Component\Uid\Uuid; | ||
use Symfony\Component\Yaml\Yaml; | ||
|
||
/** | ||
* @author Joel Wurtz <[email protected]> | ||
|
@@ -1563,4 +1565,14 @@ public function testParamDocBlock(): void | |
'foo' => ['foo1', 'foo2'], | ||
], $array); | ||
} | ||
|
||
public function testComposeSpec(): void | ||
{ | ||
$this->buildAutoMapper(); | ||
|
||
$data = Yaml::parse(file_get_contents(__DIR__ . '/Fixtures/ComposeModels/docker-starter-compose.yaml')); | ||
$dockerStarter = $this->autoMapper->map($data, Compose::class); | ||
|
||
dd($dockerStarter); | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class BlkioLimit | ||
{ | ||
public function __construct(public string|null $path = NULL, public int|string|null $rate = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class BlkioWeight | ||
{ | ||
public function __construct(public string|null $path = NULL, public int|null $weight = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class Compose | ||
{ | ||
public function __construct( | ||
public string|null $version = NULL, | ||
public string|null $name = NULL, | ||
/** @var string|null|_Include[]|null */ | ||
public array|null $include = NULL, | ||
public Service|null $services = NULL, | ||
public Network|null $networks = NULL, | ||
public Volume|null $volumes = NULL, | ||
public Secret|null $secrets = NULL, | ||
public Config|null $configs = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class Config | ||
{ | ||
public function __construct(public string|null $name = NULL, public string|null $content = NULL, public string|null $environment = NULL, public string|null $file = NULL, public bool|ConfigExternal|null $external = NULL, public string|float|bool|null|array $labels = NULL, public string|null $templateDriver = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class ConfigExternal | ||
{ | ||
public function __construct( | ||
/** @deprecated */ | ||
public string|null $name = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class Deployment | ||
{ | ||
public function __construct(public string|null $mode = NULL, public string|null $endpointMode = NULL, public int|null $replicas = NULL, public DeploymentRollbackConfig|null $rollbackConfig = NULL, public DeploymentUpdateConfig|null $updateConfig = NULL, public DeploymentResources|null $resources = NULL, public DeploymentRestartPolicy|null $restartPolicy = NULL, public DeploymentPlacement|null $placement = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentPlacement | ||
{ | ||
public function __construct( | ||
/** @var string|null[]|null */ | ||
public array|null $constraints = NULL, | ||
/** @var DeploymentPlacementPreferencesItem|null[]|null */ | ||
public array|null $preferences = NULL, | ||
public int|null $maxReplicasPerNode = NULL | ||
) | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/Fixtures/ComposeModels/DeploymentPlacementPreferencesItem.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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentPlacementPreferencesItem | ||
{ | ||
public function __construct(public string|null $spread = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentResources | ||
{ | ||
public function __construct(public DeploymentResourcesLimits|null $limits = NULL, public DeploymentResourcesReservations|null $reservations = NULL) | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/Fixtures/ComposeModels/DeploymentResourcesLimits.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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentResourcesLimits | ||
{ | ||
public function __construct(public float|string|null $cpus = NULL, public string|null $memory = NULL, public int|null $pids = NULL) | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/Fixtures/ComposeModels/DeploymentResourcesReservations.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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentResourcesReservations | ||
{ | ||
public function __construct(public float|string|null $cpus = NULL, public string|null $memory = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentRestartPolicy | ||
{ | ||
public function __construct(public string|null $condition = NULL, public string|null $delay = NULL, public int|null $maxAttempts = NULL, public string|null $window = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentRollbackConfig | ||
{ | ||
public function __construct(public int|null $parallelism = NULL, public string|null $delay = NULL, public string|null $failureAction = NULL, public string|null $monitor = NULL, public float|null $maxFailureRatio = NULL, public DeploymentRollbackConfigOrderEnum|null $order = NULL) | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/Fixtures/ComposeModels/DeploymentRollbackConfigOrderEnum.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,9 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
enum DeploymentRollbackConfigOrderEnum : string | ||
{ | ||
case START_FIRST = 'start-first'; | ||
case STOP_FIRST = 'stop-first'; | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DeploymentUpdateConfig | ||
{ | ||
public function __construct(public int|null $parallelism = NULL, public string|null $delay = NULL, public string|null $failureAction = NULL, public string|null $monitor = NULL, public float|null $maxFailureRatio = NULL, public DeploymentUpdateConfigOrderEnum|null $order = NULL) | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/Fixtures/ComposeModels/DeploymentUpdateConfigOrderEnum.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,9 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
enum DeploymentUpdateConfigOrderEnum : string | ||
{ | ||
case START_FIRST = 'start-first'; | ||
case STOP_FIRST = 'stop-first'; | ||
} |
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 AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class Development | ||
{ | ||
public function __construct( | ||
/** @var DevelopmentWatchItem|null[]|null */ | ||
public array|null $watch = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DevelopmentWatchItem | ||
{ | ||
public function __construct( | ||
/** @var string|null[]|null */ | ||
public array|null $ignore = NULL, | ||
public string|null $path = NULL, | ||
public DevelopmentWatchItemActionEnum|null $action = NULL, | ||
public string|null $target = NULL | ||
) | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/Fixtures/ComposeModels/DevelopmentWatchItemActionEnum.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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
enum DevelopmentWatchItemActionEnum : string | ||
{ | ||
case REBUILD = 'rebuild'; | ||
case SYNC = 'sync'; | ||
case SYNC_RESTART = 'sync+restart'; | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class DevicesItem | ||
{ | ||
public function __construct( | ||
/** @var string|null[]|null */ | ||
public array|null $capabilities = NULL, | ||
public string|int|null $count = NULL, | ||
/** @var string|null[]|null */ | ||
public array|null $deviceIds = NULL, | ||
public string|null $driver = NULL, | ||
public string|float|bool|null|array $options = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class EnvFileItem | ||
{ | ||
public function __construct(public string|null $path = NULL, public bool|null $required = true) | ||
{ | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class GenericResourcesItem | ||
{ | ||
public function __construct(public GenericResourcesItemDiscreteResourceSpec|null $discreteResourceSpec = NULL) | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/Fixtures/ComposeModels/GenericResourcesItemDiscreteResourceSpec.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,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class GenericResourcesItemDiscreteResourceSpec | ||
{ | ||
public function __construct(public string|null $kind = NULL, public float|null $value = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class Healthcheck | ||
{ | ||
public function __construct(public bool|null $disable = NULL, public string|null $interval = NULL, public float|null $retries = NULL, public string|null|array $test = NULL, public string|null $timeout = NULL, public string|null $startPeriod = NULL, public string|null $startInterval = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class Network | ||
{ | ||
public function __construct(public string|null $name = NULL, public string|null $driver = NULL, public string|float|null $driverOpts = NULL, public NetworkIpam|null $ipam = NULL, public bool|NetworkExternal|null $external = NULL, public bool|null $internal = NULL, public bool|null $enableIpv6 = NULL, public bool|null $attachable = NULL, public string|float|bool|null|array $labels = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class NetworkExternal | ||
{ | ||
public function __construct( | ||
/** @deprecated */ | ||
public string|null $name = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace AutoMapper\Tests\Fixtures\ComposeModels; | ||
|
||
class NetworkIpam | ||
{ | ||
public function __construct( | ||
public string|null $driver = NULL, | ||
/** @var NetworkIpamConfigItem|null[]|null */ | ||
public array|null $config = NULL, | ||
public string|null $options = NULL | ||
) | ||
{ | ||
} | ||
} |
Oops, something went wrong.