mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 03:06:43 +02:00
refactor: add rector to enforce type declarations, code quality + style and remove dead code
- update CI process to include quality stage (tests + code review) - add captainhook to install git pre-commit & pre-push hooks - remove .devcontainer Dockerfile to use project's docker-compose services: all services can now be started automatically using vscode - update docs/setup-development.md
This commit is contained in:
parent
a54a5964c3
commit
5c5c6da4be
302 changed files with 9802 additions and 4674 deletions
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
namespace Analytics\Controllers;
|
||||
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\Controller;
|
||||
|
||||
class AnalyticsController extends Controller
|
||||
|
|
@ -25,7 +27,7 @@ class AnalyticsController extends Controller
|
|||
public function _remap($method, ...$params)
|
||||
{
|
||||
if (!isset($params[1])) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$this->className = model('Analytics' . $params[1] . 'Model');
|
||||
|
|
@ -37,7 +39,7 @@ class AnalyticsController extends Controller
|
|||
);
|
||||
}
|
||||
|
||||
public function getData($podcastId, $episodeId)
|
||||
public function getData($podcastId, $episodeId): ResponseInterface
|
||||
{
|
||||
$analytics_model = new $this->className();
|
||||
$methodName = $this->methodName;
|
||||
|
|
@ -45,10 +47,10 @@ class AnalyticsController extends Controller
|
|||
return $this->response->setJSON(
|
||||
$analytics_model->$methodName($podcastId, $episodeId),
|
||||
);
|
||||
} else {
|
||||
return $this->response->setJSON(
|
||||
$analytics_model->$methodName($podcastId),
|
||||
);
|
||||
}
|
||||
|
||||
return $this->response->setJSON(
|
||||
$analytics_model->$methodName($podcastId),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue