Move some service\type::class methods into __get(), no functional changes

This commit is contained in:
2025-05-22 17:57:39 +10:00
parent 1e496a2863
commit 72b11172c8
11 changed files with 50 additions and 94 deletions

View File

@@ -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');
}
}