Added property types

This commit is contained in:
lisam 2023-07-06 10:09:41 +02:00
parent 71188fe34c
commit d6d9c293f5
10 changed files with 26 additions and 98 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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));

View file

@ -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(