This may seen rudimentary but I cant seem to directly inject any parameters into my class constructor without using annotations. Below is definition made and the class called
$shell->set('root','[Root Definition Here]');
$shell->make('Namespace\To\Product');
Class Product{
public function __construct($root){
//coding continues here
}
}
But I keep getting this error
Uncaught exception 'Exception' with message 'Entry "Namespace\To\Product" cannot be resolved: Parameter $root of __construct() has no value defined or guessable
However this issue will be resolved if I use annotations. But I really want not to resort to annotations each time I'm injecting parameters.
Whats the issue here?
Thanks