source/Parser/UserAgent/UserAgentMatcher.php
Opening brace of a class must be on the line after the definition Open
Open
class UserAgentMatcher implements UserAgentMatcherInterface {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
use LogsIfAvailableTrait;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->log("Failed to match user agent '{$userAgent}', falling back to '*'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->logger = $logger;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$uaParser = new UserAgentParser($userAgent);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($userAgent === '*') {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$userAgentMatch = $uaParser->getMostSpecific($available);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (false !== $userAgentMatch) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function __construct(?LoggerInterface $logger = null) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getMatching(string $userAgent, array $available = []): string {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->log("Matched {$userAgentMatch} for user agent {$userAgent}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $userAgentMatch;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return '*';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $userAgent;
- Exclude checks
Opening brace should be on a new line Open
Open
public function __construct(?LoggerInterface $logger = null) {
- Exclude checks
Opening brace should be on a new line Open
Open
public function getMatching(string $userAgent, array $available = []): string {
- Exclude checks