Class DefaultUrlChecker
Checks if a request object contains a valid URL
Namespace: Authentication\UrlChecker
Property Summary
-
$_defaultOptions protected
arrayDefault Options
Method Summary
-
_getChecker() protected
Gets the checker function name or a callback
-
_getUrlFromRequest() protected
Returns current url.
-
_mergeDefaultOptions() protected
Merges given options with the defaults.
-
check() public
Checks the requests if it is the configured login action
Method Detail
_getChecker() ¶ protected
_getChecker(array<string, mixed> $options): callable
Gets the checker function name or a callback
Parameters
-
array<string, mixed>$options Array of options
Returns
callable_getUrlFromRequest() ¶ protected
_getUrlFromRequest(Psr\Http\Message\ServerRequestInterface $request, bool $getFullUrl = false): string
Returns current url.
Parameters
-
Psr\Http\Message\ServerRequestInterface$request Server Request
-
bool$getFullUrl optional Get the full URL or just the path
Returns
string_mergeDefaultOptions() ¶ protected
_mergeDefaultOptions(array<string, mixed> $options): array
Merges given options with the defaults.
The reason this method exists is that it makes it easy to override the method and inject additional options without the need to use the MergeVarsTrait.
Parameters
-
array<string, mixed>$options Options to merge in
Returns
arraycheck() ¶ public
check(Psr\Http\Message\ServerRequestInterface $request, array|string $loginUrls, array<string, mixed> $options = []): bool
Checks the requests if it is the configured login action
Parameters
-
Psr\Http\Message\ServerRequestInterface$request -
array|string$loginUrls -
array<string, mixed>$options optional
Returns
boolProperty Detail
$_defaultOptions ¶ protected
Default Options
urlCheckerWhether to useloginUrlas regular expression(s).checkFullUrlWhether to check the full request URI.
Type
array