mirror of
https://github.com/anikeen-com/yaac.git
synced 2026-03-13 13:46:10 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c867f0acc6 | |||
| abd1beead7 | |||
| c33c1c1e33 | |||
|
|
8e201aadc3 | ||
|
|
720a7b69a6 | ||
|
|
80d2fb8871 |
@@ -359,7 +359,7 @@ class Client
|
|||||||
$data = json_decode((string)$response->getBody(), true);
|
$data = json_decode((string)$response->getBody(), true);
|
||||||
$accountURL = $response->getHeaderLine('Location');
|
$accountURL = $response->getHeaderLine('Location');
|
||||||
$date = (new \DateTime())->setTimestamp(strtotime($data['createdAt']));
|
$date = (new \DateTime())->setTimestamp(strtotime($data['createdAt']));
|
||||||
return new Account($data['contact'], $date, ($data['status'] == 'valid'), $accountURL);
|
return new Account($date, ($data['status'] == 'valid'), $accountURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,12 +4,6 @@ namespace Afosto\Acme\Data;
|
|||||||
|
|
||||||
class Account
|
class Account
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $contact;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
@@ -34,12 +28,10 @@ class Account
|
|||||||
* @param string $accountURL
|
* @param string $accountURL
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $contact,
|
|
||||||
\DateTime $createdAt,
|
\DateTime $createdAt,
|
||||||
bool $isValid,
|
bool $isValid,
|
||||||
string $accountURL
|
string $accountURL
|
||||||
) {
|
) {
|
||||||
$this->contact = $contact;
|
|
||||||
$this->createdAt = $createdAt;
|
$this->createdAt = $createdAt;
|
||||||
$this->isValid = $isValid;
|
$this->isValid = $isValid;
|
||||||
$this->accountURL = $accountURL;
|
$this->accountURL = $accountURL;
|
||||||
@@ -72,15 +64,6 @@ class Account
|
|||||||
return $this->accountURL;
|
return $this->accountURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return contact data
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getContact(): array
|
|
||||||
{
|
|
||||||
return $this->contact;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns validation status
|
* Returns validation status
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|||||||
Reference in New Issue
Block a user