chore: add return types to methods

This commit is contained in:
Marvin Flock
2025-08-28 20:01:58 +02:00
parent 1aa9b924d7
commit f27b87a0d8
@@ -14,7 +14,8 @@ require_once JPATH_SITE . '/components/com_sportsmanager/util/image.php';
class HTML_sportsmanager_admin
{
static function formatTimediff( $timestamp1, $timestamp2, $verbose ) {
static function formatTimediff( $timestamp1, $timestamp2, $verbose ): string
{
if (empty($timestamp1) || empty($timestamp2)) {
return "";
} else {
@@ -29,16 +30,17 @@ class HTML_sportsmanager_admin
}
}
static function formatTeamName( $team_name, $team_id, $highlight_team_id ) {
static function formatTeamName( $team_name, $team_id, $highlight_team_id ): string
{
if ($team_id == $highlight_team_id) {
return "<b><i>" . htmlentities_utf8($team_name) . "</i></b>";
} else {
return htmlentities_utf8($team_name);
}
}
static function checkZeilenumbruch($Spalte_Nr, $max_Spalten)
{
static function checkZeilenumbruch($Spalte_Nr, $max_Spalten): int
{
$Spalte_Nr++;
if ($Spalte_Nr >= $max_Spalten){
echo "</tr>\n<tr>\n";
@@ -46,10 +48,10 @@ class HTML_sportsmanager_admin
}
return $Spalte_Nr;
}
static function adminUebersicht($veranstaltungen, $spielerstatistiken, $turniere, $ranglisten, $individualwettbewerbe, $statistik, $saisons, $filter_saison_id, $externe_datenbank): void
{
global $params;
?>
<div class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style='font-weight: bold;'>
@@ -606,7 +608,7 @@ class HTML_sportsmanager_admin
static function adminEinstellungen($einstellungen): void
{
global $params;
?>
<style>
@@ -4948,7 +4950,7 @@ class HTML_sportsmanager_admin
static function adminKategorien($kategorien): void
{
global $params;
?>
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_CATEGORIES'); ?></div>
@@ -7436,7 +7438,7 @@ class HTML_sportsmanager_admin
<input type="hidden" name="task" value="admin_veranstaltung_save"/>
<input type="hidden" name="id" value="<?php echo($row != null ? $row->veranstaltung_id : "0"); ?>"/>
</form>
<script>
// Auswahlfeld Direkter Vergleich in Abhaengigkeit von Tabellenwertung anzeigen
const dropdown = document.getElementById("table_evaluation");
@@ -7595,7 +7597,7 @@ class HTML_sportsmanager_admin
:</label>
</td>
<td nowrap>
<input class="uk-select uk-form-width-medium" type="text" name="teamname" id="team_name"
<input class="uk-select uk-form-width-medium" type="text" name="teamname" id="team_name"
size="50" maxlength="50" style="height: 34px; width: 370px;"
value="<?php if ($row != null) echo htmlentities_utf8($row->teamname); ?>"/>
</td>
@@ -7606,7 +7608,7 @@ class HTML_sportsmanager_admin
:</label>
</td>
<td nowrap>
<input class="uk-select uk-form-width-medium" type="text" name="teamname_kurz" id="team_name_kurz"
<input class="uk-select uk-form-width-medium" type="text" name="teamname_kurz" id="team_name_kurz"
size="50" maxlength="24" style="height: 34px; width: 370px;"
value="<?php if ($row != null) echo htmlentities_utf8($row->teamname_kurz); ?>"/>
</td>
@@ -7673,7 +7675,7 @@ class HTML_sportsmanager_admin
:</label>
</td>
<td nowrap>
<input class="uk-select uk-form-width-medium" type="text" name="tischeigenschaften" id="table_characteristics"
<input class="uk-select uk-form-width-medium" type="text" name="tischeigenschaften" id="table_characteristics"
size="24" maxlength="50" style="height: 34px; width: 370px;"
value="<?php if ($row != null) echo htmlentities_utf8($row->tischeigenschaften); ?>"/>
</td>
@@ -8686,7 +8688,7 @@ class HTML_sportsmanager_admin
<?php echo Text::_('COM_SPORTSMANAGER_ENCOUNTERS'); ?>
'<?php echo htmlentities_utf8($veranstaltung->bezeichnung); ?>
': <?php echo Text::_('COM_SPORTSMANAGER_JOOMLA_MANAGEMENT'); ?></div>
<table style="border-spacing: 10px; width: 100%;">
<tr>
<td colspan="3" nowrap>
@@ -8697,7 +8699,7 @@ class HTML_sportsmanager_admin
<a href="<?php echo SportsManagerURL('&task=admin_begegnung_edit&veranstaltungid=' . $veranstaltung->veranstaltung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_ADD_MEETING'); ?></a>
</td>
<?php $Spalte_Nr = self::checkZeilenumbruch($Spalte_Nr, $max_Spalten); ?>
<?php if ($veranstaltung->tabellenwertung == -3 || $veranstaltung->tabellenwertung == -4){ ?>
<?php if ($veranstaltung->tabellenwertung == -3 || $veranstaltung->tabellenwertung == -4){ ?>
<td nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_begegnungen_pokalrunde_auslosen_form&veranstaltungid=' . $veranstaltung->veranstaltung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_CUP_ROUND_GENERATION'); ?></a>
</td>
@@ -8806,11 +8808,11 @@ class HTML_sportsmanager_admin
<td nowrap
style="text-align: center"><?php if ($ergebnis_vorhanden) echo $row->heim_spielpunkte . " : " . $row->gast_spielpunkte; else echo "_ : _" ?><?php if ($row->unbestaetigtes_ergebnis_id != null) echo "<br /><small>" . ($row->zwischenergebnis ? "live" : "unbest&auml;tigt") . "</small>"; ?></td>
<td nowrap align="center">
<?php echo
self::formatTimediff($row->termin_spiel, $row->ergebnis_vorgeschlagen, false)
<?php echo
self::formatTimediff($row->termin_spiel, $row->ergebnis_vorgeschlagen, false)
. " / "
. self::formatTimediff($row->ergebnis_vorgeschlagen, $row->ergebnis_akzeptiert, false);
?>
. self::formatTimediff($row->ergebnis_vorgeschlagen, $row->ergebnis_akzeptiert, false);
?>
</td>
<td nowrap><small><a
href="<?php echo SportsManagerURL('&task=admin_begegnung_heimtausch&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HOME_EXCHANGE'); ?></a></small>
@@ -9880,7 +9882,7 @@ class HTML_sportsmanager_admin
<?php
}
static function adminBegegnungenImportieren($veranstaltung): void
{
global $params;
@@ -10175,7 +10177,7 @@ class HTML_sportsmanager_admin
global $params;
$sperren = false;
$Fehlertext = "";
if ($veranstaltung->tabellenwertung == -3)
$task = "admin_begegnungen_pokalrunde_auslosen";
if ($veranstaltung->tabellenwertung == -4)
@@ -10307,7 +10309,7 @@ class HTML_sportsmanager_admin
:
</td>
<td nowrap>
<input class="uk-select uk-form-width-xsmall" style="height: 34px; text-align: left;"
<input class="uk-select uk-form-width-xsmall" style="height: 34px; text-align: left;"
name="runde" type="text" readonly value="<?php echo $veranstaltung->naechsteRunde; ?>"/>
</td>
</tr>
@@ -10317,8 +10319,8 @@ class HTML_sportsmanager_admin
:
</td>
<td nowrap>
<input list="auswahl_rundentitel" class="uk-select uk-form-width-large"
style="height: 34px; text-align: left;" type="text" name="rundentitel" size="32" maxlength="32"
<input list="auswahl_rundentitel" class="uk-select uk-form-width-large"
style="height: 34px; text-align: left;" type="text" name="rundentitel" size="32" maxlength="32"
value="<?php echo $veranstaltung->titelVorschlag; ?>"/>
<datalist id="auswahl_rundentitel" >
<?php if ($auswahl_rundentitel){ ?>
@@ -10352,7 +10354,7 @@ class HTML_sportsmanager_admin
</tr>
</table>
</div>
<?php if (!$sperren){ ?>
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/>
<?php } ?>
@@ -10362,7 +10364,7 @@ class HTML_sportsmanager_admin
</form>
<?php
if ($sperren == true)
echo "<span style='display: inline-block; height: 30px; background: red; color: white;vertical-align: middle;'>
echo "<span style='display: inline-block; height: 30px; background: red; color: white;vertical-align: middle;'>
$Fehlertext</span>\n";
}