/** * @test * @expectedException \Mcustiel\SimpleRequest\Exception\FilterDoesNotExistException * @expectedExceptionMessage Filter class Mcustiel\SimpleRequest\Validator\Minimum must implement Mcustiel\SimpleRequest\Interfaces\FilterInterface */ public function buildFailsWhenTheClassIsNotAFilter() { FilterBuilder::builder()->withClass(Minimum::class)->build(); }
/** * {@inheritdoc} * In this method, annotation param is treated as instance of AnnotationWithAssociatedClass. * * @see \Mcustiel\SimpleRequest\Strategies\Annotations\AnnotationParser::execute() */ public function execute(RequestAnnotation $annotation, PropertyParserBuilder $propertyParser) { $propertyParser->addFilter(FilterBuilder::builder()->withClass($annotation->getAssociatedClass())->withSpecification($annotation->getValue())->build()); }