Skip to content

Commit

Permalink
Merge pull request #8 from jairlopez/master
Browse files Browse the repository at this point in the history
Add PHP5.3 support
  • Loading branch information
jeremyfrench authored Jul 22, 2020
2 parents c8002a5 + 07f27c4 commit 86404ba
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
name: phpunit
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
}
],
"require": {
"php": ">5.6"
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": ">5.0"
"phpunit/phpunit": ">=4.8"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 5 additions & 5 deletions src/SameSiteException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SameSiteException
const OSX_VERSION_REGEX = "/\(Macintosh;.*Mac OS X (\d+)_(\d+)[_\d]*.*\) AppleWebKit\//";
const CHROME_VERSION_REGEX = "/Chrom[^ \/]+\/(\d+)[\.\d]* /";

public static $VALID_SAMESITE_VALUES = ['None', 'Lax', 'Strict'];
public static $VALID_SAMESITE_VALUES = array('None', 'Lax', 'Strict');

/**
* Get a safe string to use in a same site cookie for the given browser.
Expand Down Expand Up @@ -147,7 +147,7 @@ public static function dropsUnrecognizedSameSiteCookies($user_agent_string)
*/
public static function isMacosxVersion($major, $minor, $user_agent_string)
{
$matches = [];
$matches = array();
if (preg_match(self::OSX_VERSION_REGEX, $user_agent_string, $matches)) {
if ($matches[1] == $major && $matches[2] == $minor) {
return true;
Expand All @@ -168,7 +168,7 @@ public static function isMacosxVersion($major, $minor, $user_agent_string)
*/
public static function isIosVersion($major, $user_agent_string)
{
$matches = [];
$matches = array();
if (preg_match(self::IOS_VERSION_REGEX, $user_agent_string, $matches)) {
if ($matches[1] == $major) {
return true;
Expand Down Expand Up @@ -217,7 +217,7 @@ public static function isChromiumBased($user_agent_string)
*/
public static function isChromiumVersionAtLeast($major, $user_agent_string)
{
$matches = [];
$matches = array();
if (preg_match(self::CHROME_VERSION_REGEX, $user_agent_string, $matches)) {
return $major <= $matches[1];
}
Expand Down Expand Up @@ -257,7 +257,7 @@ public static function isUCBrowser($user_agent_string)
*/
public static function isUcBrowserVersionAtLeast($major, $minor, $build, $user_agent_string)
{
$matches = [];
$matches = array();
if (preg_match(self::UCBROWSER_REGEX, $user_agent_string, $matches)) {
if ($major != $matches[1]) {
return ($major < $matches[1]);
Expand Down
Loading

0 comments on commit 86404ba

Please sign in to comment.