MW
class PaySettingsDTO
{
public $setting;
public function __construct(array $setting)
{
$this->setting = $setting;
if(empty($setting['store_id'])){
throw new \InvalidArgumentException('store_id is empty');
}
if(empty($setting['password'])){
throw new \InvalidArgumentException('password is empty');
}
}
}
class PaySettingsDTO
{
private $storeId;
private $password;
public function getStoreId():int
{
return $this->storeId;
}
public function getPassword():string
{
return $this->password;
}
public function __construct(array $setting)
{
if(empty($setting['store_id'])){
throw new \InvalidArgumentException('store_id is empty');
}
if(empty($setting['password'])){
throw new \InvalidArgumentException('password is empty');
}
$this->storeId = $setting['store_id'];
$this->password = $setting['password'];
}
}