Skip to content

Commit 1bc6e70

Browse files
author
Яценко Андрей
committed
Fix: scalar type
1 parent 4ce61d8 commit 1bc6e70

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yzen.dev/plain-to-class",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Class-transformer to transform your data into a typed object",
55
"minimum-stability": "dev",
66
"prefer-stable": true,

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ClassTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function transform(string $className, $args)
5151
$propertyClassTypeName = $propertyClassType !== null ? $propertyClassType->getName() : false;
5252

5353
## if scalar type
54-
if (in_array($propertyClassType, ['int', 'float', 'string', 'bool'])) {
54+
if (in_array($propertyClassTypeName, ['int', 'float', 'string', 'bool'])) {
5555
$instance->{$item->name} = $args[$item->name];
5656
continue;
5757
}

0 commit comments

Comments
 (0)