From d6d9c293f59208bfbae00452c42e4b63a0370995 Mon Sep 17 00:00:00 2001 From: lisam Date: Thu, 6 Jul 2023 10:09:41 +0200 Subject: [PATCH] Added property types --- src/Api/Campaigns.php | 10 ++------ src/Api/Skill.php | 10 ++------ src/Api/SkillSet.php | 10 ++------ src/Configuration/Settings.php | 25 ++++--------------- src/Entity/Brand.php | 10 ++------ src/Entity/Campaign.php | 10 ++------ src/Entity/Skill.php | 15 +++-------- src/Entity/SkillSet.php | 20 +++------------ .../AutoGrantBusinessVerification.php | 2 +- src/Verification/Issuer.php | 12 +++------ 10 files changed, 26 insertions(+), 98 deletions(-) diff --git a/src/Api/Campaigns.php b/src/Api/Campaigns.php index 775d2d2..0fe1c24 100644 --- a/src/Api/Campaigns.php +++ b/src/Api/Campaigns.php @@ -31,15 +31,9 @@ use SkillDisplay\PHPToolKit\Entity\Campaign; class Campaigns { - /** - * @var Settings - */ - protected $settings; + protected Settings $settings; - /** - * @var Client - */ - protected $client; + protected Client $client; public function __construct( Settings $settings, diff --git a/src/Api/Skill.php b/src/Api/Skill.php index 5ae0a50..bbd8ebc 100644 --- a/src/Api/Skill.php +++ b/src/Api/Skill.php @@ -31,15 +31,9 @@ use SkillDisplay\PHPToolKit\Entity\Skill as Entity; class Skill { - /** - * @var Settings - */ - protected $settings; + protected Settings $settings; - /** - * @var Client - */ - protected $client; + protected Client $client; public function __construct( Settings $settings, diff --git a/src/Api/SkillSet.php b/src/Api/SkillSet.php index fb55c7a..1a3b21c 100644 --- a/src/Api/SkillSet.php +++ b/src/Api/SkillSet.php @@ -31,15 +31,9 @@ use SkillDisplay\PHPToolKit\Entity\SkillSet as Entity; class SkillSet { - /** - * @var Settings - */ - protected $settings; + protected Settings $settings; - /** - * @var Client - */ - protected $client; + protected Client $client; public function __construct( Settings $settings, diff --git a/src/Configuration/Settings.php b/src/Configuration/Settings.php index 43cb133..d4df146 100644 --- a/src/Configuration/Settings.php +++ b/src/Configuration/Settings.php @@ -6,30 +6,15 @@ namespace SkillDisplay\PHPToolKit\Configuration; class Settings { - /** - * @var string - */ - private $user_secret = ''; + private string $user_secret = ''; - /** - * @var string - */ - private $apiKey = ''; + private string $apiKey = ''; - /** - * @var int - */ - private $verifierID = 0; + private int $verifierID = 0; - /** - * @var string - */ - private $APIUrl = ''; + private string $APIUrl = ''; - /** - * @var string - */ - private $mySkillDisplayUrl = ''; + private string $mySkillDisplayUrl = ''; public function getVerifierID(): int { diff --git a/src/Entity/Brand.php b/src/Entity/Brand.php index 7f8489e..2b61143 100644 --- a/src/Entity/Brand.php +++ b/src/Entity/Brand.php @@ -27,15 +27,9 @@ use SkillDisplay\PHPToolKit\Configuration\Settings; class Brand { - /** - * @var array - */ - private $data; + private array $data; - /** - * @var Settings - */ - private $settings; + private Settings $settings; private function __construct(array $data, Settings $settings) { diff --git a/src/Entity/Campaign.php b/src/Entity/Campaign.php index 27e4b08..67aca66 100644 --- a/src/Entity/Campaign.php +++ b/src/Entity/Campaign.php @@ -27,15 +27,9 @@ use SkillDisplay\PHPToolKit\Configuration\Settings; class Campaign { - /** - * @var array - */ - private $data; + private array $data; - /** - * @var Settings - */ - private $settings; + private Settings $settings; public function __construct(array $data, Settings $settings) { diff --git a/src/Entity/Skill.php b/src/Entity/Skill.php index 72e22b6..ccca05b 100644 --- a/src/Entity/Skill.php +++ b/src/Entity/Skill.php @@ -27,20 +27,11 @@ use SkillDisplay\PHPToolKit\Configuration\Settings; class Skill { - /** - * @var array - */ - private $data; + private array $data; - /** - * @var Settings - */ - private $settings; + private Settings $settings; - /** - * @var array - */ - private $brands = []; + private array $brands = []; private function __construct(array $data, Settings $settings) { diff --git a/src/Entity/SkillSet.php b/src/Entity/SkillSet.php index e9a0293..b7a549b 100644 --- a/src/Entity/SkillSet.php +++ b/src/Entity/SkillSet.php @@ -27,25 +27,13 @@ use SkillDisplay\PHPToolKit\Configuration\Settings; class SkillSet { - /** - * @var array - */ - private $data; + private array $data; - /** - * @var Settings - */ - private $settings; + private Settings $settings; - /** - * @var array - */ - private $skills = []; + private array $skills = []; - /** - * @var Brand|null - */ - private $brand = null; + private ?Brand $brand = null; private function __construct(array $data, Settings $settings) { diff --git a/src/Example/FullSettingsRequired/AutoGrantBusinessVerification.php b/src/Example/FullSettingsRequired/AutoGrantBusinessVerification.php index 64b8171..76b82a8 100644 --- a/src/Example/FullSettingsRequired/AutoGrantBusinessVerification.php +++ b/src/Example/FullSettingsRequired/AutoGrantBusinessVerification.php @@ -14,4 +14,4 @@ use SkillDisplay\PHPToolKit\Verification\Issuer; // In order to grant an Educational Verification you just need to exchange the constant to VERIFICATION_EDUCATIONAL // (your Verifier Account needs the according permissions) $myVerificationTool = new Issuer($mySettings); -$myVerificationTool->outputResponse($myVerificationTool->issueVerification(193, '--skilldisplay-user-email--', VERIFICATION_BUSINESS, 567)); +$myVerificationTool->outputResponse($myVerificationTool->issueVerification(175, '--skilldisplay-user-email--', VERIFICATION_BUSINESS, false, 567, true)); diff --git a/src/Verification/Issuer.php b/src/Verification/Issuer.php index c885a00..9c63f01 100644 --- a/src/Verification/Issuer.php +++ b/src/Verification/Issuer.php @@ -10,15 +10,9 @@ use SkillDisplay\PHPToolKit\Configuration\Settings; class Issuer { - /** - * @var Settings - */ - private $settings; + private Settings $settings; - /** - * @var string - */ - private $apislug = '/api/v1/verification/create'; + private string $apislug = '/api/v1/verification/create'; /** * @param int $ID ID of the Skill or SkillSet @@ -26,7 +20,7 @@ class Issuer * @param string $vtype one of VERIFICATION_SELF, VERIFICATION_EDUCATIONAL, VERIFICATION_BUSINESS, VERIFICATION_CERTIFICATION * @param bool $isSkillSet * @param int $campaignId - * + * @param bool $autoConfirm * @return array */ private function generateSignedRequestData(