protected function getMetricValue(AbstractMetric $metric)
    {
        $value = $metric->getValue();
        $type  = gettype($value);
        switch ($type) {
            case 'boolean':
                return ($value) ? 'true' : 'false';

            // Numeric values
            case 'integer':
            case 'double':
                return strval($value);

            case 'NULL':
                return 'null';

            // A string cannot be empty
            case 'string':
                if (!empty($value)) {
                    return strval($value);
                }
        }

        throw new \InvalidArgumentException('Metric value is not a valid DataDog metric type: '.$type);
    }
protected function getMetricValue(AbstractMetric $metric)
    {
        $value = $metric->getValue();
        $type  = gettype($value);
        switch ($type) {
            case 'boolean':
                return ($value) ? 'true' : 'false';

            // Numeric values
            case 'integer':
            case 'double':
                return strval($value);

            case 'NULL':
                return 'null';

            // A string cannot be empty
            case 'string':
                if (!empty($value)) {
                    return strval($value);
                }
        }

        throw new \InvalidArgumentException('Metric value is not a valid DataDog metric type: '.$type);
    }
protected function getMetricValue ( AbstractMetric $ metric ) { $ value = $ metric -> getValue ( ) ; $ type = gettype ( $ value ) ; switch ( $ type ) { case 'boolean' : return ( $ value ) ? 'true' : 'false' ; // Numeric values case 'integer' : case 'double' : return strval ( $ value ) ; case 'NULL' : return 'null' ; // A string cannot be empty case 'string' : if ( ! empty ( $ value ) ) { return strval ( $ value ) ; } } throw new \ InvalidArgumentException ( 'Metric value is not a valid DataDog metric type: ' . $ type ) ; }
Gets the value for datadog

@param AbstractMetric $metric

@return null|string
Gets the value for datadog