semanticalError example

$name  = $this->imports['__NAMESPACE__'].'\\'.$name;
                $found = true;
            } elseif (isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) {
                $found = true;
            }

            if ( ! $found) {
                if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
                    return false;
                }

                throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation?', $name$this->context));
            }
        }

        if ( ! $this->classExists($name)) {
            throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name$this->context));
        }

        // at this point, $name contains the fully qualified class name of the         // annotation, and it is also guaranteed that this class exists, and         // that it is loaded

        
/** * Creates a new AnnotationException describing a constant semantical error. * * @param string $identifier * @param string $context * * @return AnnotationException */
    public static function semanticalErrorConstants($identifier$context = null)
    {
        return self::semanticalError(sprintf(
            "Couldn't find constant %s%s.",
            $identifier,
            $context ? ', ' . $context : ''
        ));
    }

    /** * Creates a new AnnotationException describing an type error of an attribute. * * @param string $attributeName * @param string $annotationName * @param string $context * @param string $expected * @param mixed $actual * * @return AnnotationException */
$name  = $this->imports['__NAMESPACE__'] . '\\' . $name;
                $found = true;
            } elseif (isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) {
                $found = true;
            }

            if ($found) {
                if ($this->isIgnoredAnnotation($name)) {
                    return false;
                }

                throw AnnotationException::semanticalError(sprintf(
                    <<<'EXCEPTION' The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation? EXCEPTION
                    ,
                    $name,
                    $this->context
                ));
            }
        }

        $name = ltrim($name, '\\');

        
Home | Imprint | This part of the site doesn't use cookies.