From db0654f9a6a7bbdefb18ef1a199f29e354187ce2 Mon Sep 17 00:00:00 2001 From: alutskevich Date: Wed, 1 May 2024 23:22:55 +0200 Subject: [PATCH 1/8] min php version is 8.2 --- MatomoTracker.php | 20 ++++++-------------- composer.json | 6 ++---- tests/Unit/MatomoTrackerTest.php | 3 +++ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/MatomoTracker.php b/MatomoTracker.php index ab76e40..f266df6 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -26,10 +26,8 @@ class MatomoTracker * Matomo base URL, for example http://example.org/matomo/ * Must be set before using the class by calling * MatomoTracker::$URL = 'http://yourwebsite.org/matomo/'; - * - * @var string */ - static public $URL = ''; + public static string $URL = ''; /** * API Version @@ -37,7 +35,7 @@ class MatomoTracker * @ignore * @var int */ - const VERSION = 1; + public const VERSION = 1; /** * @ignore @@ -49,27 +47,21 @@ class MatomoTracker * * @ignore */ - const LENGTH_VISITOR_ID = 16; + public const LENGTH_VISITOR_ID = 16; /** * Charset * @see setPageCharset * @ignore */ - const DEFAULT_CHARSET_PARAMETER_VALUES = 'utf-8'; + public const DEFAULT_CHARSET_PARAMETER_VALUES = 'utf-8'; /** * See matomo.js */ - const FIRST_PARTY_COOKIES_PREFIX = '_pk_'; - - /** - * Defines how many categories can be used max when calling addEcommerceItem(). - * @var int - */ - const MAX_NUM_ECOMMERCE_ITEM_CATEGORIES = 5; + public const FIRST_PARTY_COOKIES_PREFIX = '_pk_'; - const DEFAULT_COOKIE_PATH = '/'; + public const DEFAULT_COOKIE_PATH = '/'; private $requestMethod = null; diff --git a/composer.json b/composer.json index c4c6f98..d9552e2 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "source": "https://github.com/matomo-org/matomo-php-tracker" }, "require": { - "php": "^7.0 || ^8.0", + "php": "^8.1", "ext-json": "*" }, "suggest": { @@ -26,14 +26,12 @@ "autoload": { "classmap": ["."] }, - "autoload-dev": { "psr-4": { "\\": "tests/" } }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^10.1" + "phpunit/phpunit": "^11.1" } } diff --git a/tests/Unit/MatomoTrackerTest.php b/tests/Unit/MatomoTrackerTest.php index 1dcf5c1..703b631 100644 --- a/tests/Unit/MatomoTrackerTest.php +++ b/tests/Unit/MatomoTrackerTest.php @@ -1,4 +1,7 @@ Date: Wed, 1 May 2024 23:23:26 +0200 Subject: [PATCH 2/8] Revert "min php version is 8.2" This reverts commit db0654f9a6a7bbdefb18ef1a199f29e354187ce2. --- MatomoTracker.php | 20 ++++++++++++++------ composer.json | 6 ++++-- tests/Unit/MatomoTrackerTest.php | 3 --- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/MatomoTracker.php b/MatomoTracker.php index f266df6..ab76e40 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -26,8 +26,10 @@ class MatomoTracker * Matomo base URL, for example http://example.org/matomo/ * Must be set before using the class by calling * MatomoTracker::$URL = 'http://yourwebsite.org/matomo/'; + * + * @var string */ - public static string $URL = ''; + static public $URL = ''; /** * API Version @@ -35,7 +37,7 @@ class MatomoTracker * @ignore * @var int */ - public const VERSION = 1; + const VERSION = 1; /** * @ignore @@ -47,21 +49,27 @@ class MatomoTracker * * @ignore */ - public const LENGTH_VISITOR_ID = 16; + const LENGTH_VISITOR_ID = 16; /** * Charset * @see setPageCharset * @ignore */ - public const DEFAULT_CHARSET_PARAMETER_VALUES = 'utf-8'; + const DEFAULT_CHARSET_PARAMETER_VALUES = 'utf-8'; /** * See matomo.js */ - public const FIRST_PARTY_COOKIES_PREFIX = '_pk_'; + const FIRST_PARTY_COOKIES_PREFIX = '_pk_'; + + /** + * Defines how many categories can be used max when calling addEcommerceItem(). + * @var int + */ + const MAX_NUM_ECOMMERCE_ITEM_CATEGORIES = 5; - public const DEFAULT_COOKIE_PATH = '/'; + const DEFAULT_COOKIE_PATH = '/'; private $requestMethod = null; diff --git a/composer.json b/composer.json index d9552e2..c4c6f98 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "source": "https://github.com/matomo-org/matomo-php-tracker" }, "require": { - "php": "^8.1", + "php": "^7.0 || ^8.0", "ext-json": "*" }, "suggest": { @@ -26,12 +26,14 @@ "autoload": { "classmap": ["."] }, + "autoload-dev": { "psr-4": { "\\": "tests/" } }, + "require-dev": { - "phpunit/phpunit": "^11.1" + "phpunit/phpunit": "^9.3 || ^10.1" } } diff --git a/tests/Unit/MatomoTrackerTest.php b/tests/Unit/MatomoTrackerTest.php index 703b631..1dcf5c1 100644 --- a/tests/Unit/MatomoTrackerTest.php +++ b/tests/Unit/MatomoTrackerTest.php @@ -1,7 +1,4 @@ Date: Wed, 1 May 2024 23:22:55 +0200 Subject: [PATCH 3/8] min php version is 8.1 --- MatomoTracker.php | 20 ++++++-------------- composer.json | 6 ++---- tests/Unit/MatomoTrackerTest.php | 3 +++ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/MatomoTracker.php b/MatomoTracker.php index ab76e40..f266df6 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -26,10 +26,8 @@ class MatomoTracker * Matomo base URL, for example http://example.org/matomo/ * Must be set before using the class by calling * MatomoTracker::$URL = 'http://yourwebsite.org/matomo/'; - * - * @var string */ - static public $URL = ''; + public static string $URL = ''; /** * API Version @@ -37,7 +35,7 @@ class MatomoTracker * @ignore * @var int */ - const VERSION = 1; + public const VERSION = 1; /** * @ignore @@ -49,27 +47,21 @@ class MatomoTracker * * @ignore */ - const LENGTH_VISITOR_ID = 16; + public const LENGTH_VISITOR_ID = 16; /** * Charset * @see setPageCharset * @ignore */ - const DEFAULT_CHARSET_PARAMETER_VALUES = 'utf-8'; + public const DEFAULT_CHARSET_PARAMETER_VALUES = 'utf-8'; /** * See matomo.js */ - const FIRST_PARTY_COOKIES_PREFIX = '_pk_'; - - /** - * Defines how many categories can be used max when calling addEcommerceItem(). - * @var int - */ - const MAX_NUM_ECOMMERCE_ITEM_CATEGORIES = 5; + public const FIRST_PARTY_COOKIES_PREFIX = '_pk_'; - const DEFAULT_COOKIE_PATH = '/'; + public const DEFAULT_COOKIE_PATH = '/'; private $requestMethod = null; diff --git a/composer.json b/composer.json index c4c6f98..d9552e2 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "source": "https://github.com/matomo-org/matomo-php-tracker" }, "require": { - "php": "^7.0 || ^8.0", + "php": "^8.1", "ext-json": "*" }, "suggest": { @@ -26,14 +26,12 @@ "autoload": { "classmap": ["."] }, - "autoload-dev": { "psr-4": { "\\": "tests/" } }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^10.1" + "phpunit/phpunit": "^11.1" } } diff --git a/tests/Unit/MatomoTrackerTest.php b/tests/Unit/MatomoTrackerTest.php index 1dcf5c1..703b631 100644 --- a/tests/Unit/MatomoTrackerTest.php +++ b/tests/Unit/MatomoTrackerTest.php @@ -1,4 +1,7 @@ Date: Thu, 2 May 2024 20:49:00 +0200 Subject: [PATCH 4/8] 118 - reset php version to 7.2 --- MatomoTracker.php | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MatomoTracker.php b/MatomoTracker.php index f266df6..a6eb70c 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -27,7 +27,7 @@ class MatomoTracker * Must be set before using the class by calling * MatomoTracker::$URL = 'http://yourwebsite.org/matomo/'; */ - public static string $URL = ''; + static public $URL = ''; /** * API Version diff --git a/composer.json b/composer.json index d9552e2..298087d 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "source": "https://github.com/matomo-org/matomo-php-tracker" }, "require": { - "php": "^8.1", + "php": "^7.2 || ^8.0", "ext-json": "*" }, "suggest": { @@ -32,6 +32,6 @@ } }, "require-dev": { - "phpunit/phpunit": "^11.1" + "phpunit/phpunit": "^9.3 || ^10.1" } } From 52e1e3da2fffd85caa926e290816ab30ccf12744 Mon Sep 17 00:00:00 2001 From: alutskevich Date: Thu, 2 May 2024 20:49:38 +0200 Subject: [PATCH 5/8] 118 - revert var type --- MatomoTracker.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MatomoTracker.php b/MatomoTracker.php index a6eb70c..0adda06 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -26,6 +26,8 @@ class MatomoTracker * Matomo base URL, for example http://example.org/matomo/ * Must be set before using the class by calling * MatomoTracker::$URL = 'http://yourwebsite.org/matomo/'; + * + * @var string */ static public $URL = ''; From 75804cc138a2c3574b225f073abad1a3303a0f32 Mon Sep 17 00:00:00 2001 From: alutskevich Date: Wed, 8 May 2024 23:42:34 +0200 Subject: [PATCH 6/8] 118 - revert constant and update changelog --- CHANGELOG.md | 6 ++++++ MatomoTracker.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cfdc3e..843c00b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ This is the Developer Changelog for Matomo PHP Tracker. All breaking changes or new features are listed below. +## 3.3.0 +### Removed +- support PHP versions less than 7.2 +### Changed +- all constants are public + ## Matomo PHP Tracker 3.0.0 Attention: This version of Matomo PHP Tracker is no longer compatible with Matomo 3.x or earlier diff --git a/MatomoTracker.php b/MatomoTracker.php index 0adda06..f34a505 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -63,6 +63,12 @@ class MatomoTracker */ public const FIRST_PARTY_COOKIES_PREFIX = '_pk_'; + /** + * Defines how many categories can be used max when calling addEcommerceItem(). + * @var int + */ + public const MAX_NUM_ECOMMERCE_ITEM_CATEGORIES = 5; + public const DEFAULT_COOKIE_PATH = '/'; private $requestMethod = null; From d6a1142e1586f0870c005a0add7fb9aee8b5f5ed Mon Sep 17 00:00:00 2001 From: Michal Kleiner Date: Thu, 9 May 2024 10:13:43 +1200 Subject: [PATCH 7/8] Tweak changelog wording --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 843c00b..a84fded 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,11 @@ This is the Developer Changelog for Matomo PHP Tracker. All breaking changes or new features are listed below. -## 3.3.0 +## Matomo PHP Tracker 3.3.0 ### Removed -- support PHP versions less than 7.2 +- support for PHP versions lower than 7.2 ### Changed -- all constants are public +- all `MatomoTracker` class constants are now explicitly public ## Matomo PHP Tracker 3.0.0 From ee98f14227a36a17ddc4512aa88bbb92f4dc626e Mon Sep 17 00:00:00 2001 From: alutskevich Date: Mon, 13 May 2024 22:21:29 +0200 Subject: [PATCH 8/8] 118 - update changelog.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a84fded..fcb693e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This is the Developer Changelog for Matomo PHP Tracker. All breaking changes or - support for PHP versions lower than 7.2 ### Changed - all `MatomoTracker` class constants are now explicitly public +- all `MatomoTracker` dynamic properties are now explicitly public ## Matomo PHP Tracker 3.0.0