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:
Yassine Doghri 2021-05-19 16:35:13 +00:00
commit aa1612342e
No known key found for this signature in database
GPG key ID: 3E7F89498B960C9F
230 changed files with 3420 additions and 5884 deletions

View file

@ -24,17 +24,15 @@ class UserModel extends MythAuthUserModel
public function getPodcastContributors(int $podcastId): array
{
$cacheName = "podcast#{$podcastId}_contributors";
if (!($found = cache($cacheName))) {
if (! ($found = cache($cacheName))) {
$found = $this->select('users.*, auth_groups.name as podcast_role')
->join('podcasts_users', 'podcasts_users.user_id = users.id')
->join(
'auth_groups',
'auth_groups.id = podcasts_users.group_id',
)
->join('auth_groups', 'auth_groups.id = podcasts_users.group_id',)
->where('podcasts_users.podcast_id', $podcastId)
->findAll();
cache()->save($cacheName, $found, DECADE);
cache()
->save($cacheName, $found, DECADE);
}
return $found;
@ -42,9 +40,7 @@ class UserModel extends MythAuthUserModel
public function getPodcastContributor(int $userId, int $podcastId): ?User
{
return $this->select(
'users.*, podcasts_users.podcast_id as podcast_id, auth_groups.name as podcast_role',
)
return $this->select('users.*, podcasts_users.podcast_id as podcast_id, auth_groups.name as podcast_role',)
->join('podcasts_users', 'podcasts_users.user_id = users.id')
->join('auth_groups', 'auth_groups.id = podcasts_users.group_id')
->where([