class PageUrlMatcherRegistry (View source)

Contains matchers and matches pages.

Properties

protected AnnotationManager $annotationManager Annotation manager.
protected IPageUrlMatcher[] $matchers Registered page url matchers.

Methods

__construct(AnnotationManager $annotation_manager)

Creates PageUrlMatcherRegistry instance.

add(IPageUrlMatcher $page_url_matcher)

Adds a page url matcher instance.

boolean
match(string $url, Page $page)

Matches the url against the given page.

void
ensureAnnotationsAreValid(array $annotations, string $annotation_name)

Checks that all annotations are valid.

Expectation
shouldReceive(string $name)

No description

Details

__construct(AnnotationManager $annotation_manager)

Creates PageUrlMatcherRegistry instance.

Parameters

AnnotationManager $annotation_manager Annotation manager.

PageUrlMatcherRegistry add(IPageUrlMatcher $page_url_matcher)

Adds a page url matcher instance.

Parameters

IPageUrlMatcher $page_url_matcher Page url matcher.

Return Value

PageUrlMatcherRegistry

Exceptions

PageUrlMatcherException When page url matcher with same priority is already registered.

boolean match(string $url, Page $page)

Matches the url against the given page.

Parameters

string $url The URL.
Page $page Page to match.

Return Value

boolean

protected void ensureAnnotationsAreValid(array $annotations, string $annotation_name)

Checks that all annotations are valid.

Parameters

array $annotations Annotations.
string $annotation_name Annotation name.

Return Value

void

Exceptions

PageUrlMatcherException When annotations are not valid.

Expectation shouldReceive(string $name)

Parameters

string $name

Return Value

Expectation