for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Billogram\Model\Customer;
use Billogram\Model\CreatableFromArray;
/**
* @author Ibrahim Hizeoui <[email protected]>
*/
class CustomerContact implements CreatableFromArray
{
* @var string
private $name;
private $email;
private $phone;
public function __construct()
}
* @return string
public function getName(): string
return $this->name;
* @param string $name
*
* @return CustomerContact
public function withName(string $name)
$new = clone $this;
$new->name = $name;
return $new;
public function getEmail(): string
return $this->email;
* @param string $email
public function setEmail(string $email)
$new->email = $email;
public function getPhone(): string
return $this->phone;
* @param string $phone
public function setPhone(string $phone)
$new->phone = $phone;
public function toArray()
$data = [];
if ($this->name !== null) {
$data['name'] = $this->name;
if ($this->email !== null) {
$data['email'] = $this->email;
if ($this->phone !== null) {
$data['phone'] = $this->phone;
return $data;
* Create an API response object from the HTTP response from the API server.
* @param array $data
* @return self
public static function createFromArray(array $data)
$contact = new self();
$contact->name = $data['name'];
$contact->email = $data['email'];
$contact->phone = $data['phone'];
return $contact;