From c75aa1f2c063673b95ae7e2c63562c39eff43b7a Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 21 Sep 2020 14:42:01 +0200 Subject: [PATCH] Support PHP 7.2 and 7.3 As those are still supported and used by many Unix distributions. Many software is running on PHP 7.2 and 7.3 and the code base should support those versions. --- .github/workflows/ci.yaml | 2 ++ composer.json | 4 ++-- composer.lock | 4 ++-- src/Configuration/Settings.php | 29 ++++++++++++++++++++++++----- src/Verification/Issuer.php | 14 ++++++++++---- src/Verification/Link.php | 32 ++++++++++++++++++++++++++------ 6 files changed, 66 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e68a97b..b6a2d8e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,6 +14,8 @@ jobs: strategy: matrix: php-version: + - 7.2 + - 7.3 - 7.4 steps: - name: Checkout diff --git a/composer.json b/composer.json index 2d5bf1a..74feae4 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,9 @@ } ], "require": { - "guzzlehttp/guzzle": "^6.5", "ext-json": "*", - "php": "^7.4" + "guzzlehttp/guzzle": "^6.5", + "php": "7.2.* || 7.3.* || 7.4.*" }, "autoload": { "files": [ "src/Constants/VerificationTypes.php" ], diff --git a/composer.lock b/composer.lock index b045323..cb78ab4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5ddae281cdc978a7b2312629a0fec326", + "content-hash": "b9cf8f698cb3698b7ded4c56e55e8421", "packages": [ { "name": "guzzlehttp/guzzle", @@ -2660,7 +2660,7 @@ "prefer-lowest": false, "platform": { "ext-json": "*", - "php": "^7.4" + "php": "7.2.* || 7.3.* || 7.4.*" }, "platform-dev": [], "plugin-api-version": "1.1.0" diff --git a/src/Configuration/Settings.php b/src/Configuration/Settings.php index cbc83fb..7a86518 100644 --- a/src/Configuration/Settings.php +++ b/src/Configuration/Settings.php @@ -5,11 +5,30 @@ namespace SkillDisplay\PHPToolKit\Configuration; class Settings { - private string $user_secret; - private string $apiKey; - private int $verifierID; - private string $APIUrl; - private string $mySkillDisplayUrl; + /** + * @var string + */ + private $user_secret = ''; + + /** + * @var string + */ + private $apiKey = ''; + + /** + * @var int + */ + private $verifierID = 0; + + /** + * @var string + */ + private $APIUrl = ''; + + /** + * @var string + */ + private $mySkillDisplayUrl = ''; public function getVerifierID(): int { diff --git a/src/Verification/Issuer.php b/src/Verification/Issuer.php index 4f66719..171907e 100644 --- a/src/Verification/Issuer.php +++ b/src/Verification/Issuer.php @@ -9,8 +9,15 @@ use SkillDisplay\PHPToolKit\Configuration\Settings; class Issuer { - private Settings $settings; - private string $apislug = '/api/v1/verification/create'; + /** + * @var Settings + */ + private $settings; + + /** + * @var string + */ + private $apislug = '/api/v1/verification/create'; /** * @param int $ID ID of the Skill or SkillSet @@ -72,8 +79,7 @@ class Issuer string $useremail, string $vtype, bool $isSkillSet = false - ): ResponseInterface - { + ): ResponseInterface { $requestData = $this->generateSignedRequestData($skillID, $useremail, $vtype, $isSkillSet); $client = new \GuzzleHttp\Client(); diff --git a/src/Verification/Link.php b/src/Verification/Link.php index 4e946b5..aa197bf 100644 --- a/src/Verification/Link.php +++ b/src/Verification/Link.php @@ -12,11 +12,22 @@ use SkillDisplay\PHPToolKit\Configuration\Settings; */ class Link { - private ?int $skillID; - private Settings $settings; + /** + * @var null|int + */ + private $skillID; + + /** + * @var Settings + */ + private $settings; /* SVG Definitions */ - private string $verification_self_svg = ' + + /** + * @var string + */ + private $verification_self_svg = ' @@ -24,7 +35,10 @@ class Link '; - private string $verification_educational_svg = ' + /** + * @var string + */ + private $verification_educational_svg = ' @@ -32,7 +46,10 @@ class Link '; - private string $verification_business_svg = ' + /** + * @var string + */ + private $verification_business_svg = ' @@ -40,7 +57,10 @@ class Link '; - private string $verification_certification_svg = ' + /** + * @var string + */ + private $verification_certification_svg = '