for example
require_once "../Request.php"; class Test { protected $token = ''; protected $botname = ''; protected Request $request; //// тут ошибка } for example
require_once "../Request.php"; class Test { protected $token = ''; protected $botname = ''; protected Request $request; //// тут ошибка } Not. Not possible There is such a proposal for PHP 7.x but there is no approval for implementation yet. Read more here.
If you need to set a specific value for a property then use the class methods. for example
public method setRequest( Request $request ) { $this->request = $request; } If the goal is to get clues from the IDE, you can write this:
/** * @var Request */ protected $request; ... Source: https://ru.stackoverflow.com/questions/529253/
All Articles