Skip to content

Commit

Permalink
Add factory for string enum value object - Close #7
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrokeil committed Nov 20, 2020
1 parent 758dc30 commit 952bd0c
Show file tree
Hide file tree
Showing 11 changed files with 655 additions and 86 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
"require": {
"php": "^7.4 || ^8.0",
"open-code-modeling/json-schema-to-php": "dev-master",
"open-code-modeling/php-code-ast": "^0.8.2|dev-master"
"open-code-modeling/php-code-ast": "^0.8.6|dev-master"
},
"require-dev": {
"jangregor/phpstan-prophecy": "^0.8.0",
"laminas/laminas-filter": "^2.9",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^0.12.33",
"phpstan/phpstan-strict-rules": "^0.12.4",
Expand Down
6 changes: 4 additions & 2 deletions src/ValueObject/DateTimeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ public function nodeVisitorsFromNative(string $name, string $outputFormat = DATE
{
$nodeVisitors = $this->propertyFactory->nodeVisitorFromNative($name, 'DateTimeImmutable');

$classConstant = $this->classConstant($outputFormat);

\array_unshift(
$nodeVisitors,
new ClassConstant(
new IdentifierGenerator(
'OUTPUT_FORMAT',
$this->classConstant($outputFormat)
$classConstant->getName(),
$classConstant
)
)
);
Expand Down
Loading

0 comments on commit 952bd0c

Please sign in to comment.