/**
* @param CollaboratorManager $collaborators
* @param \ReflectionMethod $beforeMethod
*/
private function createMissingCollabolators(CollaboratorManager $collaborators, \ReflectionMethod $beforeMethod)
{
foreach ($beforeMethod->getParameters() as $parameter) {
if (!$collaborators->has($parameter->getName())) {
$collaborator = new Collaborator($this->prophet->prophesize());
if (null !== ($class = $parameter->getClass())) {
$collaborator->beADoubleOf($class->getName());
}
$collaborators->set($parameter->getName(), $collaborator);
}
}
}