public function addProtocol($protocol)
    {
        if (!\in_array($protocol, [ApiDefinition::PROTOCOL_HTTP, ApiDefinition::PROTOCOL_HTTPS], true)) {
            throw new \InvalidArgumentException(\sprintf('"%s" is not a valid protocol', $protocol));
        }

        if (!\in_array($protocol, $this->protocols, true)) {
            $this->protocols[] = $protocol;
        }
    }
public function addProtocol($protocol)
    {
        if (!\in_array($protocol, [ApiDefinition::PROTOCOL_HTTP, ApiDefinition::PROTOCOL_HTTPS], true)) {
            throw new \InvalidArgumentException(\sprintf('"%s" is not a valid protocol', $protocol));
        }

        if (!\in_array($protocol, $this->protocols, true)) {
            $this->protocols[] = $protocol;
        }
    }
public function addProtocol ( $ protocol ) { if ( ! \ in_array ( $ protocol , [ ApiDefinition :: PROTOCOL_HTTP , ApiDefinition :: PROTOCOL_HTTPS ] , true ) ) { throw new \ InvalidArgumentException ( \ sprintf ( '"%s" is not a valid protocol' , $ protocol ) ) ; } if ( ! \ in_array ( $ protocol , $ this -> protocols , true ) ) { $ this -> protocols [ ] = $ protocol ; } }
Add a supported protocol

@param string $protocol

@throws \InvalidArgumentException
Add a supported protocol