src/Rating.php
protected function parseServiceCodes(array $options)
    {
        $services = [];
        foreach ($options['service_codes'] as $serviceCode) {
            if (!array_key_exists(strtoupper($serviceCode), self::getServiceCodes())) {
                $message = sprintf(
                    'Unsupported service code: "%s". Supported services are %s',
                    $serviceCode,
                    implode(', ', array_keys(self::getServiceCodes()))
                );
                throw new \InvalidArgumentException($message);
            }
            $services[] = $serviceCode;
        }

        return $services;
    }
protected function parseServiceCodes(array $options)
    {
        $services = [];
        foreach ($options['service_codes'] as $serviceCode) {
            if (!array_key_exists(strtoupper($serviceCode), self::getServiceCodes())) {
                $message = sprintf(
                    'Unsupported service code: "%s". Supported services are %s',
                    $serviceCode,
                    implode(', ', array_keys(self::getServiceCodes()))
                );
                throw new \InvalidArgumentException($message);
            }
            $services[] = $serviceCode;
        }

        return $services;
    }
protected function parseServiceCodes ( array $ options ) { $ services = [ ] ; foreach ( $ options [ 'service_codes' ] as $ serviceCode ) { if ( ! array_key_exists ( strtoupper ( $ serviceCode ) , self :: getServiceCodes ( ) ) ) { $ message = sprintf ( 'Unsupported service code: "%s". Supported services are %s' , $ serviceCode , implode ( ', ' , array_keys ( self :: getServiceCodes ( ) ) ) ) ; throw new \ InvalidArgumentException ( $ message ) ; } $ services [ ] = $ serviceCode ; } return $ services ; }
Helper function to extract the service codes.

@param array $options
The options array.

@return array
The list of services to look up.
Helper function to extract the service codes .