Skip to content

Commit

Permalink
Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
JayBizzle committed Jan 20, 2025
1 parent 2ab6e6e commit 24d4a47
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/CrawlerDetect.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class CrawlerDetect
*
* @var array
*/
protected $httpHeaders = array();
protected $httpHeaders = [];

/**
* Store regex matches.
*
* @var array
*/
protected $matches = array();
protected $matches = [];

/**
* Crawlers object.
Expand Down Expand Up @@ -113,7 +113,7 @@ public function setHttpHeaders($httpHeaders)
}

// Clear existing headers.
$this->httpHeaders = array();
$this->httpHeaders = [];

// Only save HTTP headers. In PHP land, that means
// only _SERVER vars that start with HTTP_.
Expand Down Expand Up @@ -167,7 +167,7 @@ public function isCrawler($userAgent = null)
));

if ($agent === '') {
$this->matches = array();
$this->matches = [];

return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Fixtures/Crawlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Crawlers extends AbstractProvider
*
* @var array
*/
protected $data = array(
protected $data = [
' YLT',
'^Aether',
'^Amazon Simple Notification Service Agent$',
Expand Down Expand Up @@ -1431,5 +1431,5 @@ class Crawlers extends AbstractProvider
'ZoteroTranslationServer',
'ZyBorg',
'[a-z0-9\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer|scraper)',
);
];
}
4 changes: 2 additions & 2 deletions src/Fixtures/Exclusions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Exclusions extends AbstractProvider
*
* @var array
*/
protected $data = array(
protected $data = [
'Safari.[\d\.]*',
'Firefox.[\d\.]*',
' Chrome.[\d\.]*',
Expand Down Expand Up @@ -72,5 +72,5 @@ class Exclusions extends AbstractProvider
'super\/\d+\/Android\/\d+',
'"Yandex"',
'YandexModule2',
);
];
}
4 changes: 2 additions & 2 deletions src/Fixtures/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Headers extends AbstractProvider
*
* @var array
*/
protected $data = array(
protected $data = [
// The default User-Agent string.
'HTTP_USER_AGENT',
// Header can occur on devices using Opera Mini.
Expand All @@ -35,5 +35,5 @@ class Headers extends AbstractProvider
'HTTP_X_SCANNER', // Seen in use by Netsparker
// Observed that Facebook will omit identifying itself in User Agent headers but will persist HeadlessChrome in this header for mobile requests
'HTTP_SEC_CH_UA',
);
];
}

0 comments on commit 24d4a47

Please sign in to comment.