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

@ -9,19 +9,18 @@
namespace Analytics\Controllers;
use Analytics\Config\Analytics;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use Config\Services;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Config\Services;
use Psr\Log\LoggerInterface;
class EpisodeAnalyticsController extends Controller
{
/**
* An array of helpers to be loaded automatically upon
* class instantiation. These helpers will be available
* to all other controllers that extend Analytics.
* An array of helpers to be loaded automatically upon class instantiation. These helpers will be available to all
* other controllers that extend Analytics.
*
* @var string[]
*/
@ -40,12 +39,6 @@ class EpisodeAnalyticsController extends Controller
// Do Not Edit This Line
parent::initController($request, $response, $logger);
//--------------------------------------------------------------------
// Preload any models, libraries, etc, here.
//--------------------------------------------------------------------
// E.g.:
// $this->session = \Config\Services::session();
set_user_session_deny_list_ip();
set_user_session_location();
set_user_session_player();
@ -53,10 +46,8 @@ class EpisodeAnalyticsController extends Controller
$this->config = config('Analytics');
}
public function hit(
string $base64EpisodeData,
string ...$audioFilePath
): RedirectResponse {
public function hit(string $base64EpisodeData, string ...$audioFilePath): RedirectResponse
{
$session = Services::session();
$session->start();