<commit_before><?php

namespace Devlabs\App;

class StandingsController extends AbstractController
{
    /**
     * Default action method for rendering the standings logic
     *
     * @return view
     */
    public function index()
    {
        /**
         * Data array for keeping the variables which will be passed to the view
         */
        $data = array();

        $tournament_id = (isset($_GET['tournament_id'])) ? $_GET['tournament_id'] : "5";
        $tournament = new Tournament();
        $tournament->loadById($tournament_id);

//        $data['tournaments'] = list_all_tournaments($tournament_id);
//        $data['standings'] = list_standings($tournament_id);
//        $data['tournament_name'] = get_tournament_name($tournament_id);

        $tournaments = new TournamentCollection();
        $standings = new ScoreCollection();

        $data['selected_tournament'] = $tournament;
        $data['tournaments'] = $tournaments->getAll($tournament->id);
        $data['standings'] = $standings->getByTournament($tournament);

        return new view($this->view, $data);
    }
}<commit_msg>add comments<commit_after><?php

namespace Devlabs\App;

/**
 * Class StandingsController
 * @package Devlabs\App
 */
class StandingsController extends AbstractController
{
    /**
     * Default action method for rendering the standings logic
     *
     * @return view
     */
    public function index()
    {
        /**
         * Data array for keeping the variables which will be passed to the view
         */
        $data = array();

        /**
         * Get the tournament id by from the ULR query string
         * and load the tournament's data into an object
         */
        $tournament_id = (isset($_GET['tournament_id'])) ? $_GET['tournament_id'] : "5";
        $tournament = new Tournament();
        $tournament->loadById($tournament_id);

        /**
         * Create objects for holding the tournaments and tables' standings data
         */
        $tournaments = new TournamentCollection();
        $standings = new ScoreCollection();

        /**
         * Store the tournaments and tables' standings data
         * in the data array which will be passed to the view
         */
        $data['selected_tournament'] = $tournament;
        $data['tournaments'] = $tournaments->getAll($tournament->id);
        $data['standings'] = $standings->getByTournament($tournament);

        return new view($this->view, $data);
    }
}
{'fraction_non_alphanumeric': 0.12474686107735926, 'fraction_numerical': 0.0008100445524503848, 'mean_word_length': 2.574529667149059, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6124045', 'n_tokens_mistral': 710, 'n_tokens_neox': 659, 'n_words': 175}