src/Validator/Constraints/NodeValidator.php
public function validate($value, Constraint $constraint)
    {
        if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) {
            $this->context->addViolation('node is not given or wrong datatype');

            return;
        }

        if (empty($value)) {
            $this->context->addViolation('the node is empty and isn\'t suitable for graphite');

            return;
        }

        if (!self::validatePattern($value)) {
            $this->context->addViolation('the node : '.$value.' isn\'t suitable for graphite');

            return;
        }
    }
public function validate($value, Constraint $constraint)
    {
        if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) {
            $this->context->addViolation('node is not given or wrong datatype');

            return;
        }

        if (empty($value)) {
            $this->context->addViolation('the node is empty and isn\'t suitable for graphite');

            return;
        }

        if (!self::validatePattern($value)) {
            $this->context->addViolation('the node : '.$value.' isn\'t suitable for graphite');

            return;
        }
    }
{@inheritDoc}