PhpSpec\Runner\CollaboratorManager::has PHP Method

has() public method

public has ( string $name ) : boolean
$name string
return boolean
    public function has($name)
    {
        return isset($this->collaborators[$name]);
    }

Usage Example

 /**
  * @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);
         }
     }
 }
All Usage Examples Of PhpSpec\Runner\CollaboratorManager::has