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

@ -13,7 +13,7 @@ use CodeIgniter\HTTP\RedirectResponse;
class HomeController extends BaseController
{
public function index(): RedirectResponse|string
public function index(): RedirectResponse | string
{
$model = new PodcastModel();
@ -21,13 +21,13 @@ class HomeController extends BaseController
// check if there's only one podcast to redirect user to it
if (count($allPodcasts) === 1) {
return redirect()->route('podcast-activity', [
$allPodcasts[0]->name,
]);
return redirect()->route('podcast-activity', [$allPodcasts[0]->name]);
}
// default behavior: list all podcasts on home page
$data = ['podcasts' => $allPodcasts];
$data = [
'podcasts' => $allPodcasts,
];
return view('home', $data);
}
}