Zend\Code\Generator\ClassGenerator::validateConstantValue PHP Method

validateConstantValue() private method

private validateConstantValue ( mixed $value ) : void
$value mixed
return void
    private function validateConstantValue($value)
    {
        if (null === $value || is_scalar($value)) {
            return;
        }
        if (is_array($value)) {
            array_walk($value, [$this, 'validateConstantValue']);
            return;
        }
        throw new Exception\InvalidArgumentException(sprintf('Expected value for constant, value must be a "scalar" or "null", "%s" found', gettype($value)));
    }