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 AutomaticWriteOff implements CreatableFromArray
{
* @var string
private $setting;
* @var int
private $amount;
* @return string
public function getSetting()
return $this->setting;
}
* @param string $setting
*
* @return AutomaticWriteOff
public function withSetting(string $setting)
$new = clone $this;
$new->setting = $setting;
return $new;
* @return int
public function getAmount()
return $this->amount;
* @param int $amount
public function withAmount(int $amount)
$new->amount = $amount;
public function toArray()
$data = [];
if ($this->setting !== null && $this->amount !== null) {
$data['settings'] = $this->setting;
$data['amount'] = $this->amount;
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)
$automaticWriteoff = new self();
$automaticWriteoff->setting = $data['settings'] ?? null;
$automaticWriteoff->amount = $data['amount'] ?? null;
return $automaticWriteoff;