Skip to content

Commit

Permalink
Add some typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Aug 1, 2024
1 parent 34c53e3 commit 3c26bee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/midcom/admin/folder/handler/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
* Sort navigation order.
Expand All @@ -22,7 +23,7 @@ class midcom_admin_folder_handler_order extends midcom_baseclasses_components_ha
/**
* Set the score.
*/
private function _process_order_form(Request $request)
private function _process_order_form(Request $request) : ?Response
{
// Form has been handled if cancel has been pressed
if ($request->request->has('f_cancel')) {
Expand All @@ -32,7 +33,7 @@ private function _process_order_form(Request $request)

// If the actual score list hasn't been posted, return
if (!$request->request->has('f_submit')) {
return;
return null;
}

if ($request->request->has('f_navorder')) {
Expand Down
2 changes: 1 addition & 1 deletion lib/midcom/baseclasses/components/handler/dataexport.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private function _init_csv_variables(Request $request)
}
}

private function encode_csv(string $data)
private function encode_csv(string $data) : string
{
/* START: Quick'n'Dirty on-the-fly charset conversion */
if ($this->csv['charset'] !== 'UTF-8') {
Expand Down
2 changes: 1 addition & 1 deletion lib/midcom/connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static function verify_password(string $password, string $hash) : bool
return $password === $hash;
}

public static function prepare_password(string $password)
public static function prepare_password(string $password) : string
{
if (midcom::get()->config->get('auth_type') == 'Legacy') {
return password_hash($password, PASSWORD_DEFAULT);
Expand Down

0 comments on commit 3c26bee

Please sign in to comment.