handles single param

@param   \stubbles\input\valuereader\CommonValueReader  $valueReader  instance to filter value with
@param   \stubbles\reflect\annotation\Annotation        $annotation   annotation which contains filter metadata
@return  string
346123
protected function filter(CommonValueReader $valueReader, Annotation $annotation)
    {
        return $valueReader->ifIsOneOf($this->allowedValues($annotation));
    }
930885
public static function parseSimpleAnnotationValue($annotation, $docComment)
    {
        $matches = [];
        preg_match("#@$annotation\\s+([^\\s]+)#", $docComment, $matches);
        return !empty($matches) ? $matches[1] : null;
    }
1270490
protected function getDocumentRepository(
        ReflectionClass $reflectionClass,
        AnnotationReader $annotationReader
    ): ?string {
        $annotations = $annotationReader->getClassAnnotations($reflectionClass);

        foreach ($annotations as $annotation) {
            if ($annotation instanceof Document) {
                return $annotation->repositoryClass;
            }
        }

        return null;
    }
816788
public function required(string $errorId = 'FIELD_EMPTY'): valuereader\CommonValueReader
    {
        if ($this->value->isNull()) {
            return new valuereader\MissingValueReader(
                    function($actualErrorId)
                    {
                        $this->paramErrors->append($this->paramName, $actualErrorId);
                    },
                    $errorId
            );
        }

        return $this;
    }
475083
public static function parse(StreamReader $streamReader)
    {
        $pos = $startPos = $streamReader->getOffset();
        $openBrackets = 1;
        do {
            $buffer = $streamReader->getBuffer(false);
            for ($length = \strlen($buffer); $openBrackets !== 0 && $pos < $length; $pos++) {
                switch ($buffer[$pos]) {
                    case '(':
                        $openBrackets++;
                        break;
                    case ')':
                        $openBrackets--;
                        break;
                    case '\\':
                        $pos++;
                }
            }
        } while ($openBrackets !== 0 && $streamReader->increaseLength());

        $result = \substr($buffer, $startPos, $openBrackets + $pos - $startPos - 1);
        $streamReader->setOffset($pos);

        $v = new self;
        $v->value = $result;

        return $v;
    }
76982
private ParamValueLoader findHandlerMethodAnnotation(final Class<? extends Annotation> annoType, ActContext<?> ctx) {
        if (null == ctx) {
            return ParamValueLoader.NIL;
        }
        return new ParamValueLoader.NonCacheable() {
            @Override
            public Object load(Object bean, ActContext<?> ctx, boolean noDefaultValue) {
                Method handlerMethod = ctx.handlerMethod();
                Method curMethod = ctx.currentMethod();
                boolean methodIsCurrent = handlerMethod == curMethod || null == curMethod;

                Annotation anno = handlerMethod.getAnnotation(annoType);
                if (null == anno && !methodIsCurrent) {
                    anno = curMethod.getAnnotation(annoType);
                }
                return anno;
            }
        };
    }
622862
protected function initReaderInstance($initValue)
    {
        $position = $this->parser->getStreamReader()->getPosition()
            + $this->parser->getStreamReader()->getOffset() + $this->fileHeaderOffset;

        if ($initValue instanceof PdfToken && $initValue->value === 'xref') {
            try {
                return new FixedReader($this->parser);
            } catch (CrossReferenceException $e) {
                $this->parser->getStreamReader()->reset($position);
                $this->parser->getTokenizer()->clearStack();

                return new LineReader($this->parser);
            }
        }

        if ($initValue instanceof PdfIndirectObject) {
            // check for encryption
            $stream = PdfStream::ensure($initValue->value);

            $type = PdfDictionary::get($stream->value, 'Type');
            if ($type->value !== 'XRef') {
                throw new CrossReferenceException(
                    'The xref position points to an incorrect object type.',
                    CrossReferenceException::INVALID_DATA
                );
            }

            $this->checkForEncryption($stream->value);

            throw new CrossReferenceException(
                'This PDF document probably uses a compression technique which is not supported by the ' .
                'free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)',
                CrossReferenceException::COMPRESSED_XREF
            );
        }

        throw new CrossReferenceException(
            'The xref position points to an incorrect object type.',
            CrossReferenceException::INVALID_DATA
        );
    }
964922
public function parser(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        $injectValue = $objectAnnotation->getName();
        $envValue    = $objectAnnotation->getEnv();
        if (empty($injectValue) && empty($envValue)) {
            throw new \InvalidArgumentException("the name and env of @Value can't be empty! class={$className} property={$propertyName}");
        }

        $isRef          = false;
        $injectProperty = null;
        if (!empty($injectValue)) {
            list($injectProperty, $isRef) = $this->annotationResource->getTransferProperty($injectValue);
        }

        if (!empty($envValue)) {
            $value          = $this->getEnvValue($envValue);
            $isArray        = $this->isEnvArrayValue($className, $propertyName);
            $value          = $this->getTransferEnvValue($value, $isArray);
            $injectProperty = ($value !== null) ? $value : $injectProperty;
            $isRef          = ($value !== null) ? false : $isRef;
        }

        return [$injectProperty, $isRef];
    }
780566
protected function getMethodAnnotations(ReflectionClass $class, SimpleAnnotationReader $reader)
	{
		$annotations = [];

		foreach ($class->getMethods() as $method)
		{
			$results = $reader->getMethodAnnotations($method);

			if (count($results) > 0)
				$annotations[$method->name] = $results;
		}

		return $annotations;
	}
777029
public function normalize(PageUrlAnnotation $annotation)
	{
		$parser = new Parser($this->baseUrl);
		$parser->merge(new Parser($annotation->url));

		$parser->setParams(array_merge($parser->getParams(), $annotation->params));

		$ret = $parser->getComponents();

		if ( $annotation->secure !== null && !empty($ret['scheme']) ) {
			$ret['scheme'] = $annotation->secure ? 'https' : 'http';
		}

		return $ret;
	}
1313489
public function parser(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        $beanName = $objectAnnotation->getName();
        $beanName = empty($beanName) ? $className : $beanName;
        $scope    = Scope::SINGLETON;

        DefinitionCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);

        return [$beanName, $scope, ""];
    }
403775
public function parser(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        $name     = $objectAnnotation->getName();
        $scope    = $objectAnnotation->getScope();
        $ref      = $objectAnnotation->getRef();
        $beanName = empty($name) ? $className : $name;

        return [$beanName, $scope, $ref];
    }
1099571
private function initAnnotationReader()
    {
        AnnotationRegistry::registerFile(
            $this->getVendorDir().'/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
        );

        // annotations require custom autoloading
        AnnotationRegistry::registerAutoloadNamespaces([
            'JMS\Serializer\Annotation' => $this->getVendorDir().'/jms/serializer/src/',
        ]);

        AnnotationRegistry::registerLoader(function ($classname) {
            if (0 === strpos($classname, 'BackBee')) {
                return class_exists($classname);
            }

            if (0 === strpos($classname, 'Symfony\Component\Validator\Constraints')) {
                return class_exists($classname);
            }

            return false;
        });
    }
552002
public static function getAnnotationReader()
    {
        if (self::$annotationReader === null) {
            self::$annotationReader = new CachedReader(new AnnotationReader(), new ArrayCache());
        }

        return self::$annotationReader;
    }
705167
protected function parseRelation($field, ValueExpression $valueExpression)
    {
        // TODO: parse relations
        $this->query->has($field, $valueExpression->getValue());
    }
28126
private function configureTokenReader(TokenReader $reader)
    {
        $count = count($this->parameters);
        for ($i = 0; $i < $count; $i++) {
            $method_name = "Set" . $this->parameters[$i]->getName();
            $value = $this->parameters[$i]->getValue();
            $reader->$method_name($value);
        }
    }
764009
private function propertyToField($propertyValue, AbstractField $annotation)
    {
        $fieldType = $annotation->type;
        switch ($fieldType) {
            case 'string':
                $fieldValue = strval($propertyValue);
                break;
            case 'bool':
                $fieldValue = boolval($propertyValue);
                break;
            case 'int':
                $fieldValue = intval($propertyValue);
                break;
            case 'float':
                $fieldValue = floatval($propertyValue);
                break;
            case 'array':
                $fieldValue = is_array($propertyValue) ? $propertyValue : (array)($propertyValue);
                break;
            case 'date':
                /** @var UTCDateTime $propertyValue */
                $fieldValue = ($propertyValue instanceof UTCDateTime) ? $propertyValue->toDateTime()->setTimezone(new \DateTimeZone(date_default_timezone_get())) : $propertyValue;
                break;
            case 'id':
                /** @var ObjectId $propertyValue */
                $fieldValue = $propertyValue;
                break;
            case 'embedOne':
                $fieldValue = $this->propertyToEmbedOne($propertyValue, $annotation);
                break;
            case 'embedMany':
                $fieldValue = $this->propertyToEmbedMany((array)$propertyValue, $annotation);
                break;
            case 'raw':
                $fieldValue = $propertyValue;
                break;
            default:
                $fieldValue = $propertyValue;
                break;
        }
        return $fieldValue;
    }