Copy link
Copy Markdown
Where are the type-hints?
Why not just check declared property name with name of arguments and then auto assign to them?
To keep Type Hinting:
class Foo { public $bar; public function __construct(User $bar) { // auto matching `public $bar` with `User $bar` with the named. // this just one rule for user to keep in mind: // You MUST matching the name to auto assign by yourself. } }
Copy link
Copy Markdown
Member Author
Where are the type-hints?
Typehints are where they always are. You can write __construct(User $this->user) {} for example.
Why not just check declared property name with name of arguments and then auto assign to them?
That would break backwards compatibility and would be too much implicit magic.
Closed