private function validateRates(array $rates)
    {
        foreach ($rates as $rate) {
            if (!is_scalar($rate)) {
                throw new \InvalidArgumentException(sprintf(
                    'Rates passed to the PhpArray service must be scalars, "%s" given.',
                    gettype($rate)
                ));
            }
        }
    }