public function getControllerByIp(string $ip): ControllerInterface
    {
        $speakers = $this->getSpeakers();
        if (!array_key_exists($ip, $speakers)) {
            throw new NotFoundException("Unable to find a speaker for the IP address '{$ip}'");
        }

        $group = $speakers[$ip]->getGroup();

        foreach ($this->getControllers() as $controller) {
            if ($controller->getGroup() === $group) {
                return $controller;
            }
        }
    }
public function getControllerByIp(string $ip): ControllerInterface
    {
        $speakers = $this->getSpeakers();
        if (!array_key_exists($ip, $speakers)) {
            throw new NotFoundException("Unable to find a speaker for the IP address '{$ip}'");
        }

        $group = $speakers[$ip]->getGroup();

        foreach ($this->getControllers() as $controller) {
            if ($controller->getGroup() === $group) {
                return $controller;
            }
        }
    }
public function getControllerByIp ( string $ ip ) : ControllerInterface { $ speakers = $ this -> getSpeakers ( ) ; if ( ! array_key_exists ( $ ip , $ speakers ) ) { throw new NotFoundException ( "Unable to find a speaker for the IP address '{$ip}'" ) ; } $ group = $ speakers [ $ ip ] -> getGroup ( ) ; foreach ( $ this -> getControllers ( ) as $ controller ) { if ( $ controller -> getGroup ( ) === $ group ) { return $ controller ; } } }
Get the coordinator for the specified ip address.

@param string $ip The ip address of the speaker

@return ControllerInterface
Get the coordinator for the specified ip address .