Typehint some Controllers (#5106)

* Typehint to Controllers

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
This commit is contained in:
Luc SANCHEZ
2023-03-21 18:57:57 +01:00
committed by GitHub
parent e679d3df0e
commit 247215ffaa
11 changed files with 122 additions and 97 deletions

View File

@@ -8,8 +8,9 @@ class FreshRSS_api_Controller extends FreshRSS_ActionController {
/**
* Update the user API password.
* Return an error message, or `false` if no error.
* @return false|string
*/
public static function updatePassword($apiPasswordPlain) {
public static function updatePassword(string $apiPasswordPlain) {
$username = Minz_Session::param('currentUser');
$userConfig = FreshRSS_Context::$user_conf;
@@ -35,12 +36,12 @@ class FreshRSS_api_Controller extends FreshRSS_ActionController {
* Parameter is:
* - apiPasswordPlain: the new user password
*/
public function updatePasswordAction() {
public function updatePasswordAction(): void {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(403);
}
$return_url = array('c' => 'user', 'a' => 'profile');
$return_url = ['c' => 'user', 'a' => 'profile'];
if (!Minz_Request::isPost()) {
Minz_Request::forward($return_url, true);