davtk / nette-schema-reflection
Tuned Nette Schema
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 28
pkg:composer/davtk/nette-schema-reflection
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: 2025-10-05 06:12:45 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.