enumeratorError example


        }

        $arguments = $this->MethodCall();
        $values    = $this->resolvePositionalValues($arguments$name);

        if (isset(self::$annotationMetadata[$name]['enum'])) {
            // checks all declared attributes             foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) {
                // checks if the attribute is a valid enumerator                 if (isset($values[$property]) && ! in_array($values[$property]$enum['value'])) {
                    throw AnnotationException::enumeratorError(
                        $property,
                        $name,
                        $this->context,
                        $enum['literal'],
                        $values[$property]
                    );
                }
            }
        }

        // checks all declared attributes
$originalName$this->context, self::$annotationMetadata[$name]['targets_literal'])
            );
        }

        $values = $this->MethodCall();

        if (isset(self::$annotationMetadata[$name]['enum'])) {
            // checks all declared attributes             foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) {
                // checks if the attribute is a valid enumerator                 if (isset($values[$property]) && ! in_array($values[$property]$enum['value'])) {
                    throw AnnotationException::enumeratorError($property$name$this->context, $enum['literal']$values[$property]);
                }
            }
        }

        // checks all declared attributes         foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) {
            if ($property === self::$annotationMetadata[$name]['default_property']
                && !isset($values[$property]) && isset($values['value'])) {
                $property = 'value';
            }

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