Bug Description
I am not sure, if I am using this right, but I am trying to convert input string to result DateTime object
Steps To Reproduce
https://fiddle.nette.org/nette/#4f2cd78abf
class Foo {
public \DateTime $bar;
}
$processor = new \Nette\Schema\Processor;
$processor->process(
\Nette\Schema\Expect::structure([
'bar' => \Nette\Schema\Expect::string()->castTo('DateTime')
])->castTo(Foo::class),
[
'bar' => '2021-01-01',
]
);
Will result in the error:
Nette\Utils\Arrays::toObject(): Argument #1 ($array) must be of type iterable, string given, called in ...../vendor/nette/schema/src/Schema/Elements/Base.php on line 174
Expected Behavior
Input string will be successfully mapped to target class DateTime property.
Bug Description
I am not sure, if I am using this right, but I am trying to convert input string to result DateTime object
Steps To Reproduce
https://fiddle.nette.org/nette/#4f2cd78abf
Will result in the error:
Expected Behavior
Input string will be successfully mapped to target class DateTime property.