blessing-skin-server/app/Services/Rejection.php
2019-09-02 23:33:51 +08:00

35 lines
586 B
PHP

<?php
namespace App\Services;
use Illuminate\Support\Arr;
class Rejection
{
/** @var string */
protected $reason;
/** @var mixed */
protected $data;
public function __construct(string $reason, $data = [])
{
$this->reason = $reason;
$this->data = $data;
}
public function getReason(): string
{
return $this->reason;
}
public function getData($key = null, $default = null)
{
if (is_null($key)) {
return $this->data;
}
return Arr::get($this->data, $key, $default);
}
}