Net/Notifier/WebSocket/Handshake.php
protected function getSupportedProtocol(array $supported, array $requested)
    {
        $supportedProtocol = null;

        foreach ($requested as $protocol) {
            if (in_array($protocol, $supported)) {
                $supportedProtocol = $protocol;
                break;
            }
        }

        return $supportedProtocol;
    }
protected function getSupportedProtocol(array $supported, array $requested)
    {
        $supportedProtocol = null;

        foreach ($requested as $protocol) {
            if (in_array($protocol, $supported)) {
                $supportedProtocol = $protocol;
                break;
            }
        }

        return $supportedProtocol;
    }
protected function getSupportedProtocol ( array $ supported , array $ requested ) { $ supportedProtocol = null ; foreach ( $ requested as $ protocol ) { if ( in_array ( $ protocol , $ supported ) ) { $ supportedProtocol = $ protocol ; break ; } } return $ supportedProtocol ; }
Gets the first supported protocol from a list of requested protocols

@param array $supported the list of supported protocols.
@param array $requested the list of requested protocols.

@return string|null the first matching requested protocol in the list
of supported protocols or null if no such protocol
exists.
Gets the first supported protocol from a list of requested protocols