Ignore basic methods, improving code coverage.

This commit is contained in:
James Cole
2018-06-02 06:18:07 +02:00
parent ddc1d81665
commit ba01c4bbe8
22 changed files with 104 additions and 89 deletions

View File

@@ -27,6 +27,7 @@ use Carbon\Carbon;
/**
* @codeCoverageIgnore
* Class Login
*/
class Login extends SpectreObject
@@ -68,6 +69,34 @@ class Login extends SpectreObject
/** @var Carbon */
private $updatedAt;
/**
* Login constructor.
*
* @param array $data
*/
public function __construct(array $data)
{
$this->consentGivenAt = new Carbon($data['consent_given_at']);
$this->consentTypes = $data['consent_types'];
$this->countryCode = $data['country_code'];
$this->createdAt = new Carbon($data['created_at']);
$this->updatedAt = new Carbon($data['updated_at']);
$this->customerId = $data['customer_id'];
$this->dailyRefresh = $data['daily_refresh'];
$this->holderInfo = new Holder($data['holder_info']);
$this->id = (int)$data['id'];
$this->lastAttempt = new Attempt($data['last_attempt']);
$this->lastSuccessAt = new Carbon($data['last_success_at']);
$this->nextRefreshPossibleAt = new Carbon($data['next_refresh_possible_at']);
$this->providerCode = $data['provider_code'];
$this->providerId = $data['provider_id'];
$this->providerName = $data['provider_name'];
$this->showConsentConfirmation = $data['show_consent_confirmation'];
$this->status = $data['status'];
$this->storeCredentials = $data['store_credentials'];
}
/**
* @return string
*/
@@ -76,6 +105,22 @@ class Login extends SpectreObject
return $this->countryCode;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Attempt
*/
public function getLastAttempt(): Attempt
{
return $this->lastAttempt;
}
/**
* @return Carbon
*/
@@ -108,53 +153,6 @@ class Login extends SpectreObject
return $this->updatedAt;
}
/**
* Login constructor.
*
* @param array $data
*/
public function __construct(array $data)
{
$this->consentGivenAt = new Carbon($data['consent_given_at']);
$this->consentTypes = $data['consent_types'];
$this->countryCode = $data['country_code'];
$this->createdAt = new Carbon($data['created_at']);
$this->updatedAt = new Carbon($data['updated_at']);
$this->customerId = $data['customer_id'];
$this->dailyRefresh = $data['daily_refresh'];
$this->holderInfo = new Holder($data['holder_info']);
$this->id = (int)$data['id'];
$this->lastAttempt = new Attempt($data['last_attempt']);
$this->lastSuccessAt = new Carbon($data['last_success_at']);
$this->nextRefreshPossibleAt = new Carbon($data['next_refresh_possible_at']);
$this->providerCode = $data['provider_code'];
$this->providerId = $data['provider_id'];
$this->providerName = $data['provider_name'];
$this->showConsentConfirmation = $data['show_consent_confirmation'];
$this->status = $data['status'];
$this->storeCredentials = $data['store_credentials'];
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Attempt
*/
public function getLastAttempt(): Attempt
{
return $this->lastAttempt;
}
/**
* @return array
*/