Move some service\type::class methods into __get(), no functional changes
This commit is contained in:
@@ -17,6 +17,15 @@ class SSL extends Type
|
||||
protected $public_key = NULL;
|
||||
protected $crt_parse = NULL;
|
||||
|
||||
public function __get($key): mixed
|
||||
{
|
||||
return match ($key) {
|
||||
'in_contract' => FALSE,
|
||||
|
||||
default => parent::__get($key),
|
||||
};
|
||||
}
|
||||
|
||||
/* STATIC METHODS */
|
||||
|
||||
public static function boot()
|
||||
@@ -82,25 +91,4 @@ class SSL extends Type
|
||||
? Arr::get($this->crt_parse,'subject.CN')
|
||||
: Arr::get(openssl_csr_get_subject($this->csr),'CN','');
|
||||
}
|
||||
|
||||
/**
|
||||
* Certificates have no contract and can be cancelled anytime.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function inContract(): bool
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
/**
|
||||
* @return Carbon|null
|
||||
* @deprecated use getServiceExpireAttribute()
|
||||
*/
|
||||
public function getValidToAttribute()
|
||||
{
|
||||
abort(500,'use getServiceExpireAttribute');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user