Skip to content

Commit f2ff577

Browse files
authored
Merge pull request #49 from picamator/development
Release 5.4.1
2 parents 7b2e805 + ca26f5a commit f2ff577

File tree

46 files changed

+515
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+515
-239
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $customerTransfer->lastName = 'Kowalski';
5757
Key Features
5858
------------
5959

60-
**Symfony Compatability:**
60+
**Symfony Compatibility:**
6161

6262
* Provides Symfony console command:
6363
* [TransferGeneratorCommand](/src/Command/TransferGeneratorCommand.php)

composer.lock

Lines changed: 32 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/definition/transfer-generator.transfer.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ DefinitionProperty:
4343
propertyName:
4444
type: string
4545
required:
46-
buildInType:
47-
type: DefinitionBuildInType
46+
builtInType:
47+
type: DefinitionBuiltInType
4848
transferType:
4949
type: DefinitionEmbeddedType
5050
collectionType:
@@ -71,9 +71,9 @@ DefinitionAttribute:
7171
type: DefinitionNamespace
7272
required:
7373

74-
DefinitionBuildInType:
74+
DefinitionBuiltInType:
7575
name:
76-
enumType: "Picamator\\TransferObject\\TransferGenerator\\Definition\\Enum\\BuildInTypeEnum"
76+
enumType: "Picamator\\TransferObject\\TransferGenerator\\Definition\\Enum\\BuiltInTypeEnum"
7777
required:
7878
docBlock:
7979
type: string

src/DefinitionGenerator/Content/DefinitionContentFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Picamator\TransferObject\DefinitionGenerator\Content\Builder\ContentBuilder;
88
use Picamator\TransferObject\DefinitionGenerator\Content\Builder\ContentBuilderInterface;
99
use Picamator\TransferObject\DefinitionGenerator\Content\Expander\BuilderExpanderInterface;
10-
use Picamator\TransferObject\DefinitionGenerator\Content\Expander\BuildInTypeBuilderExpander;
10+
use Picamator\TransferObject\DefinitionGenerator\Content\Expander\BuiltInTypeBuilderExpander;
1111
use Picamator\TransferObject\DefinitionGenerator\Content\Expander\CollectionTypeBuilderExpander;
1212
use Picamator\TransferObject\DefinitionGenerator\Content\Expander\TransferTypeBuilderExpander;
1313
use Picamator\TransferObject\DefinitionGenerator\Content\Reader\ContentReader;
@@ -40,14 +40,14 @@ protected function createBuilderExpander(): BuilderExpanderInterface
4040

4141
$builderExpander
4242
->setNextExpander($this->createCollectionTypeBuilderExpander())
43-
->setNextExpander($this->createBuildInTypeBuilderExpander());
43+
->setNextExpander($this->createBuiltInTypeBuilderExpander());
4444

4545
return $builderExpander;
4646
}
4747

48-
protected function createBuildInTypeBuilderExpander(): BuilderExpanderInterface
48+
protected function createBuiltInTypeBuilderExpander(): BuilderExpanderInterface
4949
{
50-
return new BuildInTypeBuilderExpander();
50+
return new BuiltInTypeBuilderExpander();
5151
}
5252

5353
protected function createCollectionTypeBuilderExpander(): BuilderExpanderInterface

src/DefinitionGenerator/Content/Expander/BuildInTypeBuilderExpander.php renamed to src/DefinitionGenerator/Content/Expander/BuiltInTypeBuilderExpander.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
use Picamator\TransferObject\DefinitionGenerator\Content\Enum\ObjectTypeEnum;
1313
use Picamator\TransferObject\DefinitionGenerator\Exception\DefinitionGeneratorException;
1414
use Picamator\TransferObject\Generated\DefinitionBuilderTransfer;
15-
use Picamator\TransferObject\Generated\DefinitionBuildInTypeTransfer;
15+
use Picamator\TransferObject\Generated\DefinitionBuiltInTypeTransfer;
1616
use Picamator\TransferObject\Generated\DefinitionEmbeddedTypeTransfer;
1717
use Picamator\TransferObject\Generated\DefinitionPropertyTransfer;
1818
use Picamator\TransferObject\Shared\Parser\DocBlockParserTrait;
19-
use Picamator\TransferObject\TransferGenerator\Definition\Enum\BuildInTypeEnum;
19+
use Picamator\TransferObject\TransferGenerator\Definition\Enum\BuiltInTypeEnum;
2020

21-
final class BuildInTypeBuilderExpander extends AbstractBuilderExpander
21+
final class BuiltInTypeBuilderExpander extends AbstractBuilderExpander
2222
{
2323
use DocBlockParserTrait;
2424

@@ -130,23 +130,23 @@ private function createDateTimePropertyTransfer(string $propertyName): Definitio
130130
return $propertyTransfer;
131131
}
132132

133-
private function createPropertyTransfer(string $propertyName, string $buildInType): DefinitionPropertyTransfer
133+
private function createPropertyTransfer(string $propertyName, string $builtInType): DefinitionPropertyTransfer
134134
{
135-
$tapeWithDocBlock = $this->parseTypeWithDocBlock($buildInType) ?? [];
135+
$tapeWithDocBlock = $this->parseTypeWithDocBlock($builtInType) ?? [];
136136

137137
/** @var string $type */
138138
$type = array_key_first($tapeWithDocBlock);
139-
$type = BuildInTypeEnum::from($type);
139+
$type = BuiltInTypeEnum::from($type);
140140

141141
$docBlock = array_first($tapeWithDocBlock);
142142

143-
$buildInTypeTransfer = new DefinitionBuildInTypeTransfer();
144-
$buildInTypeTransfer->name = $type;
145-
$buildInTypeTransfer->docBlock = $docBlock;
143+
$builtInTypeTransfer = new DefinitionBuiltInTypeTransfer();
144+
$builtInTypeTransfer->name = $type;
145+
$builtInTypeTransfer->docBlock = $docBlock;
146146

147147
$propertyTransfer = new DefinitionPropertyTransfer();
148148
$propertyTransfer->propertyName = $propertyName;
149-
$propertyTransfer->buildInType = $buildInTypeTransfer;
149+
$propertyTransfer->builtInType = $builtInTypeTransfer;
150150

151151
return $propertyTransfer;
152152
}

src/DefinitionGenerator/Generator/Render/TemplateRender.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public function renderContent(DefinitionContentTransfer $contentTransfer): strin
6969
private function renderProperty(DefinitionPropertyTransfer $propertyTransfer): string
7070
{
7171
return match (true) {
72-
$propertyTransfer->buildInType !== null
73-
=> $this->renderBuildInType($propertyTransfer),
72+
$propertyTransfer->builtInType !== null
73+
=> $this->renderBuiltInType($propertyTransfer),
7474

7575
$propertyTransfer->transferType !== null
7676
=> $this->renderTransferType($propertyTransfer),
@@ -125,22 +125,22 @@ private function renderTransferType(DefinitionPropertyTransfer $propertyTransfer
125125
);
126126
}
127127

128-
private function renderBuildInType(DefinitionPropertyTransfer $propertyTransfer): string
128+
private function renderBuiltInType(DefinitionPropertyTransfer $propertyTransfer): string
129129
{
130-
/** @var \Picamator\TransferObject\Generated\DefinitionBuildInTypeTransfer $buildInType */
131-
$buildInType = $propertyTransfer->buildInType;
130+
/** @var \Picamator\TransferObject\Generated\DefinitionBuiltInTypeTransfer $builtInType */
131+
$builtInType = $propertyTransfer->builtInType;
132132

133-
return $buildInType->docBlock
133+
return $builtInType->docBlock
134134
? sprintf(
135135
self::TYPE_WITH_DOC_BLOCK_TEMPLATE,
136136
$propertyTransfer->propertyName,
137-
$buildInType->name->value,
138-
$buildInType->docBlock,
137+
$builtInType->name->value,
138+
$builtInType->docBlock,
139139
)
140140
: sprintf(
141141
self::TYPE_TEMPLATE,
142142
$propertyTransfer->propertyName,
143-
$buildInType->name->value,
143+
$builtInType->name->value,
144144
);
145145
}
146146
}

src/Generated/DefinitionBuildInTypeTransfer.php renamed to src/Generated/DefinitionBuiltInTypeTransfer.php

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Generated/DefinitionPropertyTransfer.php

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Transfer/AbstractTransfer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final public function __construct(?array $data = null)
4949
{
5050
$this->initData();
5151

52-
if ($data !== null && count($data) > 0) {
52+
if ($data !== null && \count($data) > 0) {
5353
$this->hydrateData($data);
5454
}
5555
}
@@ -101,7 +101,7 @@ final public function getIterator(): Traversable
101101
final public function __clone(): void
102102
{
103103
/** @var \SplFixedArray<mixed> $data */
104-
$data = unserialize(serialize($this->_data));
104+
$data = \unserialize(\serialize($this->_data));
105105

106106
$this->_data = $data;
107107
}
@@ -131,7 +131,7 @@ final public function fromArray(array $data): static
131131
{
132132
$this->initData();
133133

134-
if (count($data) > 0) {
134+
if (\count($data) > 0) {
135135
$this->hydrateData($data);
136136
}
137137

@@ -155,7 +155,7 @@ private function hydrateData(array $data): void
155155
{
156156
$this->filterData($data);
157157

158-
if (count($data) === 0) {
158+
if (\count($data) === 0) {
159159
return;
160160
}
161161

0 commit comments

Comments
 (0)