mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-14 20:17:46 +02:00
style(ecs): add easy-coding-standard to enforce coding style rules for php
- update .devcontainer settings: remove auto-formatting for php + set intelephense as default formatter - remove prettier php plugin as it lacks php 8 support - add captain hook action for checking style pre-commit - fix style with ecs on all files except views
This commit is contained in:
parent
fb3593f828
commit
aa1612342e
230 changed files with 3420 additions and 5884 deletions
|
|
@ -10,7 +10,6 @@ namespace ActivityPub\Models;
|
|||
|
||||
use ActivityPub\Entities\Activity;
|
||||
use CodeIgniter\Database\BaseResult;
|
||||
use CodeIgniter\Database\Exceptions\DataException;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use DateTimeInterface;
|
||||
use Michalsn\Uuid\UuidModel;
|
||||
|
|
@ -21,6 +20,7 @@ class ActivityModel extends UuidModel
|
|||
* @var string
|
||||
*/
|
||||
protected $table = 'activitypub_activities';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
@ -49,6 +49,7 @@ class ActivityModel extends UuidModel
|
|||
* @var string
|
||||
*/
|
||||
protected $returnType = Activity::class;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
|
|
@ -58,16 +59,19 @@ class ActivityModel extends UuidModel
|
|||
* @var bool
|
||||
*/
|
||||
protected $useTimestamps = true;
|
||||
|
||||
protected $updatedField;
|
||||
|
||||
public function getActivityById(string $activityId): ?Activity
|
||||
{
|
||||
$cacheName =
|
||||
config('ActivityPub')->cachePrefix . "activity#{$activityId}";
|
||||
if (!($found = cache($cacheName))) {
|
||||
config('ActivityPub')
|
||||
->cachePrefix . "activity#{$activityId}";
|
||||
if (! ($found = cache($cacheName))) {
|
||||
$found = $this->find($activityId);
|
||||
|
||||
cache()->save($cacheName, $found, DECADE);
|
||||
cache()
|
||||
->save($cacheName, $found, DECADE);
|
||||
}
|
||||
|
||||
return $found;
|
||||
|
|
@ -86,7 +90,7 @@ class ActivityModel extends UuidModel
|
|||
string $payload,
|
||||
DateTimeInterface $scheduledAt = null,
|
||||
?string $status = null
|
||||
): BaseResult|int|string|false {
|
||||
): BaseResult | int | string | false {
|
||||
return $this->insert(
|
||||
[
|
||||
'actor_id' => $actorId,
|
||||
|
|
@ -102,7 +106,7 @@ class ActivityModel extends UuidModel
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Activity[]
|
||||
* @return Activity[]
|
||||
*/
|
||||
public function getScheduledActivities(): array
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue