mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-04 15:26:43 +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
|
|
@ -14,7 +14,6 @@ use CodeIgniter\Database\BaseResult;
|
|||
use CodeIgniter\I18n\Time;
|
||||
use DateTimeInterface;
|
||||
use Michalsn\Uuid\UuidModel;
|
||||
use Modules\Fediverse\Config\Fediverse;
|
||||
use Modules\Fediverse\Entities\Activity;
|
||||
|
||||
class ActivityModel extends UuidModel
|
||||
|
|
@ -35,17 +34,17 @@ class ActivityModel extends UuidModel
|
|||
protected $uuidFields = ['id', 'post_id'];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $afterInsert = ['notify'];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $afterUpdate = ['notify'];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $allowedFields = [
|
||||
'id',
|
||||
|
|
@ -78,7 +77,7 @@ class ActivityModel extends UuidModel
|
|||
public function getActivityById(string $activityId): ?Activity
|
||||
{
|
||||
$cacheName =
|
||||
config(Fediverse::class)
|
||||
config('Fediverse')
|
||||
->cachePrefix . "activity#{$activityId}";
|
||||
if (! ($found = cache($cacheName))) {
|
||||
$found = $this->find($activityId);
|
||||
|
|
@ -133,11 +132,12 @@ class ActivityModel extends UuidModel
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array<string, array<string|int, mixed>> $data
|
||||
* @param array<mixed> $data
|
||||
* @return array<string, array<string|int, mixed>>
|
||||
*/
|
||||
protected function notify(array $data): array
|
||||
{
|
||||
/** @var ?Activity $activity */
|
||||
$activity = (new self())->find(is_array($data['id']) ? $data['id'][0] : $data['id']);
|
||||
|
||||
if (! $activity instanceof Activity) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue