<commit_before><?php
/**
 * Minds Payments API - Subscribers
 *
 * @version 1
 * @author <NAME>
 */
namespace Minds\Controllers\api\v1\payments;

use Minds\Core;
use Minds\Helpers;
use Minds\Interfaces;
use Minds\Api\Factory;
use Minds\Core\Payments;

class subscribers implements Interfaces\Api
{
    /**
     * Returns an entities subscribers
     * @param array $pages
     *
     * API:: /v1/payments/subscribers/:plan
     */
    public function get($pages)
    {
        if (!isset($pages[0])) {
            return Factory::response([]);
        }
        $offset = isset($_GET['offset']) ? $_GET['offset'] : '';
        $repo = new Payments\Plans\Repository();

        $guids = $repo
            ->setEntityGuid(Core\Session::getLoggedInUser()->guid)
            ->getAllSubscribers($pages[0], [
                'offset' => $offset
            ]);

        if ($offset) {
            array_shift($guids);
        }

        $response = [];

        if ($guids) {
            $subscribers = Core\Entities::get([ 'guids' => $guids ]);

            $response['subscribers'] = Factory::exportable($subscribers);

            if ($subscribers) {
                $response['load-next'] = (string) end($subscribers)->guid;
            }
        }

        return Factory::response($response);
    }
<commit_msg>(fix): return only exclusive subscribed<commit_after><?php
/**
 * Minds Payments API - Subscribers
 *
 * @version 1
 * @author <NAME>
 */
namespace Minds\Controllers\api\v1\payments;

use Minds\Core;
use Minds\Helpers;
use Minds\Interfaces;
use Minds\Api\Factory;
use Minds\Core\Payments;

class subscribers implements Interfaces\Api
{
    /**
     * Returns an entities subscribers
     * @param array $pages
     *
     * API:: /v1/payments/subscribers/:plan
     */
    public function get($pages)
    {
        if (!isset($pages[0])) {
            return Factory::response([]);
        }
        $offset = isset($_GET['offset']) ? $_GET['offset'] : '';
        $repo = new Payments\Plans\Repository();

        $guids = $repo
            ->setEntityGuid(Core\Session::getLoggedInUser()->guid)
            ->getAllSubscribers($pages[1], [
                'offset' => $offset
            ]);

        if ($offset) {
            array_shift($guids);
        }

        $response = [];

        if ($guids) {
            $subscribers = Core\Entities::get([ 'guids' => $guids ]);

            $response['subscribers'] = Factory::exportable($subscribers);

            if ($subscribers) {
                $response['load-next'] = (string) end($subscribers)->guid;
            }
        }

        return Factory::response($response);
    }

{'fraction_non_alphanumeric': 0.15660377358490565, 'fraction_numerical': 0.0037735849056603774, 'mean_word_length': 2.1005847953216374, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '2223844', 'n_tokens_mistral': 815, 'n_tokens_neox': 798, 'n_words': 148}