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