mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 18:56:42 +02:00
refactor: add modules folder to phpstan paths + fix errors
This commit is contained in:
parent
7a6d9df6db
commit
bb628f355f
166 changed files with 452 additions and 526 deletions
|
|
@ -28,7 +28,7 @@ class SubscriptionModel extends Model
|
|||
protected $primaryKey = 'id';
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $allowedFields = [
|
||||
'id',
|
||||
|
|
@ -55,17 +55,17 @@ class SubscriptionModel extends Model
|
|||
protected $useTimestamps = true;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $afterInsert = ['clearCache'];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $afterUpdate = ['clearCache'];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $beforeDelete = ['clearCache'];
|
||||
|
||||
|
|
@ -131,8 +131,13 @@ class SubscriptionModel extends Model
|
|||
*/
|
||||
protected function clearCache(array $data): array
|
||||
{
|
||||
/** @var ?Subscription */
|
||||
$subscription = (new self())->find(is_array($data['id']) ? $data['id'][0] : $data['id']);
|
||||
|
||||
if (! $subscription instanceof Subscription) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
cache()
|
||||
->delete("subscription#{$subscription->id}");
|
||||
cache()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue