<commit_before><?php
/**
 * Minds Wire Rewards
 *
 * @version 1
 * @author <NAME>
 *
 */
namespace Minds\Controllers\api\v1\wire;

use Minds\Interfaces;
use Minds\Api\Factory;
use Minds\Core;
use Minds\Core\Payments;
use Minds\Entities;
use Minds\Entities\User;

class rewards implements Interfaces\Api
{
    /**
     * GET
     */
    public function get($pages)
    {
        if ($pages[1] === 'entity') {
            $entity = Entities\Factory::build($pages[0]);

            if ($entity) {
                $user = $entity->type == 'user' ? $entity : $entity->getOwnerEntity();
            }
        } else {<commit_msg>Added login check to rewards endpoint for Sentry bug<commit_after><?php
/**
 * Minds Wire Rewards
 *
 * @version 1
 * @author <NAME>
 *
 */
namespace Minds\Controllers\api\v1\wire;

use Minds\Interfaces;
use Minds\Api\Factory;
use Minds\Core;
use Minds\Core\Payments;
use Minds\Entities;
use Minds\Entities\User;

class rewards implements Interfaces\Api
{
    /**
     * GET
     */
    public function get($pages)
    {
        if (!Core\Session::getLoggedinUser()) {
            return Factory::response([
                'status' => 'error',
                'message' => 'You must be logged in to access this endpoint',
            ]);
        }

        if ($pages[1] === 'entity') {
            $entity = Entities\Factory::build($pages[0]);

            if ($entity) {
                $user = $entity->type == 'user' ? $entity : $entity->getOwnerEntity();
            }
        } else {
{'fraction_non_alphanumeric': 0.1499339498018494, 'fraction_numerical': 0.005284015852047556, 'mean_word_length': 2.1962025316455698, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '3204546', 'n_tokens_mistral': 479, 'n_tokens_neox': 476, 'n_words': 110}