Convert snake_case class functions to camelCase. (#61)

Convert moodView class functions to camelCase

Closes https://gitea.subcultureofone.org/greg/tkr/issues/34

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/61
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
This commit is contained in:
Greg Sarjeant 2025-08-06 01:07:50 +00:00 committed by greg
parent 6123757c37
commit 38c35f9bff
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ declare(strict_types=1);
$view = new MoodView(); $view = new MoodView();
$moodPicker = $view->render_mood_picker(self::getEmojisWithLabels(), $app['user']->mood); $moodPicker = $view->renderMoodPicker(self::getEmojisWithLabels(), $app['user']->mood);
$vars = [ $vars = [
'config' => $app['config'], 'config' => $app['config'],

View File

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
class MoodView { class MoodView {
private function render_emoji_groups(array $emojiGroups, string $currentMood): string { private function renderEmojiGroups(array $emojiGroups, string $currentMood): string {
$selected_emoji = $currentMood; //user->mood; $selected_emoji = $currentMood; //user->mood;
ob_start(); ob_start();
@ -29,12 +29,12 @@ class MoodView {
return ob_get_clean(); return ob_get_clean();
} }
function render_mood_picker(array $emojiGroups, string $currentMood): string { function renderMoodPicker(array $emojiGroups, string $currentMood): string {
ob_start(); ob_start();
?> ?>
<form method="post" class="emoji-form"> <form method="post" class="emoji-form">
<input type="hidden" name="csrf_token" value="<?= Util::escape_html($_SESSION['csrf_token']) ?>"> <input type="hidden" name="csrf_token" value="<?= Util::escape_html($_SESSION['csrf_token']) ?>">
<?= $this->render_emoji_groups($emojiGroups, $currentMood) ?> <?= $this->renderEmojiGroups($emojiGroups, $currentMood) ?>
<div class="button-group"> <div class="button-group">
<button type="submit" name="action" value="set">Set the mood</button> <button type="submit" name="action" value="set">Set the mood</button>
<button type="submit" name="action" value="clear" class="clear-button">Clear mood</button> <button type="submit" name="action" value="clear" class="clear-button">Clear mood</button>