Open and1truong opened 10 years ago
<?php namespace MyProject { class Person { use LazyGetSetTrait; /** @var string */ private $name; /** @var Person */ private $father; } } $pa = new MyProject\Person(); $pa->setName('Pa be Quyen'); $person = new MyProject\Person(); $person->setName('Quyen Dap Chai'); $person->setFather($pa); // ok $person->setFather('Pa be Quyen'); // Unexpected…Exception echo $person->getName(); // Quyen Dap Chai echo $person->getFather->getName(); // Pa be Quyen
Thank you @quyenbui for first draft
Should check https://github.com/mnapoli/PhpDocReader
Some notes