davtk / nette-schema-reflection
Tuned Nette Schema
dev-master / 1.2.x-dev
2023-02-05 00:08 UTC
Requires
- php: >=8.1 <8.3
- nette/utils: ^3.1.5 || ^4.0
Requires (Dev)
- nette/tester: ^2.4
- phpstan/phpstan-nette: ^1.0
- tracy/tracy: ^2.7
This package is auto-updated.
Last update: 2024-05-05 02:50:32 UTC
README
Original Nette schema: https://github.com/nette/schema
Additional functionality:
Instantiate object via Reflection
Let's imagine following class:
class Foo { public function __construct( public int $a, public int $b, ) { } }
Casting to this class will result in ArgumentCountError because Schema is instantiating the class using new keyword.
I solved this with adding second argument to castTo: castTo(string $type, bool $usingReflection = false): self
- default behavior is not changed, so it's not causing BC break.