source/Parser/DirectiveProcessors/UserAgentProcessor.php
Opening brace of a class must be on the line after the definition Open
Open
class UserAgentProcessor extends AbstractDirectiveProcessor implements DirectiveProcessorInterface {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->log('New useragent is equal to current one, skipping ...');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$prevParts = explode(':', $prevLine);
- 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
$root[$newUserAgent] = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return Directive::USERAGENT;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($newUserAgent === $currentUserAgent) {
- 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
$pervLineUserAgent = trim($prevParts[1]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$parts = explode(':', $line);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($this->matches($prevLine)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getDirectiveName(): string {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (empty($root) && $newUserAgent === '*') {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$currentUserAgent = trim($parts[1]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$root[$pervLineUserAgent] = & $root[$currentUserAgent];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!isset($root[$currentUserAgent])) {
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// if one user-agent is followed by another one - just link them
- 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
$root[$currentUserAgent] = [];
- 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 process(string $line, array & $root, string & $currentUserAgent = '*', string $prevLine = '') {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$newUserAgent = trim($parts[1]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Opening brace should be on a new line Open
Open
public function process(string $line, array & $root, string & $currentUserAgent = '*', string $prevLine = '') {
- Exclude checks
Opening brace should be on a new line Open
Open
public function getDirectiveName(): string {
- Exclude checks