I build an interface to an implementation like this :
And it is working when i use this in controller :
public function __construct(UserRepositoryInterface $repository)
But i would like to use the same solution in another class with his construct method but i got error if i don't give the parameter when the class is init with :
$class = new ClassName();
Someone already got this problem ?