diff --git a/.gitignore b/.gitignore index 3a9875b..caa152b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor/ composer.lock +/.idea/ diff --git a/src/Client.php b/src/Client.php index 78557ad..2eccf09 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,9 +11,18 @@ */ class Client { - private $http_client; - private $token; - private $config; + + protected $http_client; + + /** + * @var string + */ + protected $token; + + /** + * @var array + */ + protected $config; /** * construct function that builds the client class @@ -25,6 +34,7 @@ public function __construct(array $config = []) if (isset($this->config['http_client'])) { $this->http_client = $this->config['http_client']; + unset($this->config['http_client']); } else { $this->http_client = new \GuzzleHttp\Client([ 'base_uri' => $this->getBaseURL(), @@ -72,6 +82,9 @@ public function setToken(string $token) : void $this->token = (new Parser())->parse($token); } + /** + * @return Token + */ public function getToken() : Token { return $this->token; @@ -198,6 +211,9 @@ public function countries() : Service\CountryService return $this->countries; } + /** + * @return array + */ public function getDefaultConfig() : array { return [ @@ -218,7 +234,7 @@ public function getBaseURL() : string * Function gets the Api url * @return string Returns a string containing the api url */ - private function getApiURL() : string + protected function getApiURL() : string { return $this->config['apiURI']; } @@ -227,7 +243,7 @@ private function getApiURL() : string * Function gets the Api Version * @return string Returns a string containing the Api Version */ - private function getApiVersion() : string + protected function getApiVersion() : string { return 'v1'; } diff --git a/src/Exception/APIException.php b/src/Exception/APIException.php index b86bc90..632120e 100644 --- a/src/Exception/APIException.php +++ b/src/Exception/APIException.php @@ -7,7 +7,7 @@ */ class APIException extends \RuntimeException { - private $correlationID = null; + protected $correlationID = null; /** * Sets the CorrelationID diff --git a/src/ListResult.php b/src/ListResult.php index 3f2b9b0..d6f9c03 100644 --- a/src/ListResult.php +++ b/src/ListResult.php @@ -7,14 +7,14 @@ */ class ListResult implements \Iterator { - private $client; - private $targetClass; - private $endpoint; - private $params; - private $pageSize = 10; - private $currentPagePos = null; - private $currentRecordPos = null; - private $currentRecordSet = []; + protected $client; + protected $targetClass; + protected $endpoint; + protected $params; + protected $pageSize = 10; + protected $currentPagePos = null; + protected $currentRecordPos = null; + protected $currentRecordSet = []; /** * This constructor is used to build the ListResult diff --git a/src/Models/Company.php b/src/Models/Company.php index ecbc7e0..3f452d5 100644 --- a/src/Models/Company.php +++ b/src/Models/Company.php @@ -10,28 +10,28 @@ class Company { - private $client; - private $companyID; - private $businessName; - private $registeredCompanyName; - private $companyRegistrationNumber; - private $country; - private $companyRegistrationDate; - private $mainAddress; - private $otherAddresses; - private $commentaries; - private $history; - private $currentDirectors; - private $previousDirectors; - private $creditScore; - private $shareholders; - private $issuedShareCapital; - private $numberOfSharesIssued; - private $mortgageSummary; - private $mortgages; - private $negativeInfo; - private $rawDetails; - private $financialStatements; + protected $client; + protected $companyID; + protected $businessName; + protected $registeredCompanyName; + protected $companyRegistrationNumber; + protected $country; + protected $companyRegistrationDate; + protected $mainAddress; + protected $otherAddresses; + protected $commentaries; + protected $history; + protected $currentDirectors; + protected $previousDirectors; + protected $creditScore; + protected $shareholders; + protected $issuedShareCapital; + protected $numberOfSharesIssued; + protected $mortgageSummary; + protected $mortgages; + protected $negativeInfo; + protected $rawDetails; + protected $financialStatements; /** * Function constructs the Company Class diff --git a/src/Models/Company/CreditScore.php b/src/Models/Company/CreditScore.php index 4173196..47046de 100644 --- a/src/Models/Company/CreditScore.php +++ b/src/Models/Company/CreditScore.php @@ -9,11 +9,11 @@ */ class CreditScore { - private $company; - private $currentCreditRating; - private $currentContractLimit; - private $previousCreditRating; - private $latestRatingChangeDate; + protected $company; + protected $currentCreditRating; + protected $currentContractLimit; + protected $previousCreditRating; + protected $latestRatingChangeDate; /** * Function constructs the CreditScore Class diff --git a/src/Models/Company/Director.php b/src/Models/Company/Director.php index 7aa1ade..c3c4eef 100644 --- a/src/Models/Company/Director.php +++ b/src/Models/Company/Director.php @@ -9,9 +9,9 @@ */ class Director { - private $company; - private $directorDetails; - private $current; + protected $company; + protected $directorDetails; + protected $current; /** * Function constructs the Director Class diff --git a/src/Models/Company/FinancialStatement.php b/src/Models/Company/FinancialStatement.php index cb0bbb8..272759d 100644 --- a/src/Models/Company/FinancialStatement.php +++ b/src/Models/Company/FinancialStatement.php @@ -10,8 +10,8 @@ class FinancialStatement { - private $company; - private $statementDetails; + protected $company; + protected $statementDetails; /** * Function constructs the FinancialStatement Class diff --git a/src/Models/Company/Shareholder.php b/src/Models/Company/Shareholder.php index bf3d20d..d3c11c9 100644 --- a/src/Models/Company/Shareholder.php +++ b/src/Models/Company/Shareholder.php @@ -9,8 +9,8 @@ */ class Shareholder { - private $company; - private $shareholderDetails; + protected $company; + protected $shareholderDetails; /** * [__construct description] * @param Company $company Used to store the client in the Company Class diff --git a/src/Models/CompanySearchResult.php b/src/Models/CompanySearchResult.php index 9f07425..44a7bbe 100644 --- a/src/Models/CompanySearchResult.php +++ b/src/Models/CompanySearchResult.php @@ -7,16 +7,72 @@ */ class CompanySearchResult { - private $client; - private $id; - private $country; - private $regNo; - private $safeNo; - private $name; - private $address; - private $status; - private $type; - private $dateOfLatestChange; + protected $client; + + /** + * @var string + */ + protected $id; + + /** + * @var string|null + */ + protected $country; + + /** + * @var string|null + */ + protected $regNo; + + /** + * @var string|null + */ + protected $safeNo; + + /** + * @var array|null + */ + protected $vatNo; + + /** + * @var string|null + */ + protected $name; + + /** + * @var array|null + */ + protected $address; + + /** + * @var string|null + */ + protected $status; + + /** + * @var mixed|null + */ + protected $type; + + /** + * @var string|null + */ + protected $officeType; + + /** + * @var array|null + */ + protected $tradingNames; + + /** + * @var string|null + */ + protected $dateOfLatestChange; + + /** + * @var string|null + */ + protected $activityCode; /** * Function constructs the CompanySearchResult Class @@ -35,6 +91,9 @@ public function __construct($client, array $companyDetails) $this->address = $companyDetails['address'] ?? null; $this->status = $companyDetails['status'] ?? null; $this->type = $companyDetails['type'] ?? null; + $this->officeType = $companyDetails['officeType'] ?? null; + $this->vatNo = $companyDetails['vatNo'] ?? []; + $this->tradingNames = $companyDetails['tradingNames'] ?? []; $this->dateOfLatestChange = $companyDetails['dateOfLatestChange'] ?? null; } @@ -110,6 +169,30 @@ public function getType() : string return $this->type ?? ''; } + /** + * @return string Get OfficeType + */ + public function getOfficeType() : string + { + return $this->officeType ?? ''; + } + + /** + * @return array + */ + public function getTradingNames() : array + { + return $this->tradingNames ?? []; + } + + /** + * @return array + */ + public function getVatNo() : array + { + return $this->vatNo ?? []; + } + /** * * @return DateTime Get Date Of Latest Change diff --git a/src/Service/CompanyEventService.php b/src/Service/CompanyEventService.php index a14c14c..c1b9754 100644 --- a/src/Service/CompanyEventService.php +++ b/src/Service/CompanyEventService.php @@ -9,8 +9,8 @@ */ class CompanyEventService { - private $client; - private $id; + protected $client; + protected $id; /** * This Constructor builds the CompaniesEvents Class diff --git a/src/Service/CompanyService.php b/src/Service/CompanyService.php index bc9cf7e..e8711b1 100644 --- a/src/Service/CompanyService.php +++ b/src/Service/CompanyService.php @@ -11,8 +11,8 @@ */ class CompanyService { - private $client; - private $id; + protected $client; + protected $id; /** * This constructor builds the CompanyServices Class diff --git a/src/Service/CountryService.php b/src/Service/CountryService.php index 8e47a30..ed3eae3 100644 --- a/src/Service/CountryService.php +++ b/src/Service/CountryService.php @@ -10,7 +10,7 @@ class CountryService { - private $client; + protected $client; /** * This Constructor builds the Countries Class