<commit_before><?php

namespace App\Http\Controllers;

use DateTime;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Member;


class StatisticsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function getIndex()
    {
        $result = [];

        $members = Member::orderBy('created_at', 'asc')->get(array('created_at'));

        foreach ($members as $member) {
            // Make a frequency array mapping date=>frequency`
            $date = new DateTime($member->created_at);
            $formattedDate = $date->format('d/m/Y');
            if (array_key_exists($formattedDate, $result)) {
                $result[$formattedDate]++;
            } else {
                $result[$formattedDate] = 1;
            }
        }


        return response()->json($result);

    }

}
<commit_msg>Member Statistics<commit_after><?php

namespace App\Http\Controllers;

use DateTime;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Member;


class StatisticsController extends Controller
{
    /**
     * Display the member statistics
     *
     * Will return JSON mapping date => number of users who registered on date.
     * Note: Return JSON should have dates in order, but not guaranteed.
     *
     * @return Response
     */
    public function getMembers()
    {
        $result = [];

        $members = Member::orderBy('created_at', 'asc')->get(array('created_at'));

        foreach ($members as $member) {
            // Make a frequency array mapping date=>frequency`
            $date = $member->created_at->format('d/m/Y');
            if (array_key_exists($date, $result)) {
                $result[$date]++;
            } else {
                $result[$date] = 1;
            }
        }

        return response()->json($result);
    }

}

{'fraction_non_alphanumeric': 0.12976313079299692, 'fraction_numerical': 0.0010298661174047373, 'mean_word_length': 2.200988467874794, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '6262052', 'n_tokens_mistral': 544, 'n_tokens_neox': 539, 'n_words': 131}