<commit_before><?php

namespace Laddr;

use Emergence\People\Person;
use Tag;
use TagItem;

class PeopleRequestHandler extends \PeopleRequestHandler
{
    public static $accountLevelBrowse = false;
    public static $browseOrder = array('ID' => 'DESC');

    public static function handleBrowseRequest($options = [], $conditions = [], $responseID = null, $responseData = [])
    {

        // apply tag filter
        if (!empty($_REQUEST['tag'])) {
            // get tag
            if (!$Tag = Tag::getByHandle($_REQUEST['tag'])) {
                return static::throwNotFoundError('Tag not found');
            }

            $conditions[] = 'ID IN (SELECT ContextID FROM tag_items WHERE TagID = '.$Tag->ID.' AND ContextClass = "'.\DB::escape(Person::getStaticRootClass()).'")';
        }


        $responseData['membersTotal'] = Person::getCount();
        $responseData['membersTags']['byTech'] = TagItem::getTagsSummary(array(
            'tagConditions' => array(
                'Handle LIKE "tech.%"'
            )
            ,'itemConditions' => array(
                'ContextClass' => Person::getStaticRootClass()
            )
            ,'limit' => 10
        ));
        $responseData['membersTags']['byTopic'] = TagItem::getTagsSummary(array(<commit_msg>Add default page size of 30 for members page<commit_after><?php

namespace Laddr;

use Emergence\People\Person;
use Tag;
use TagItem;

class PeopleRequestHandler extends \PeopleRequestHandler
{
    public static $accountLevelBrowse = false;
    public static $browseOrder = ['ID' => 'DESC'];
    public static $browseLimitDefault = 30;

    public static function handleBrowseRequest($options = [], $conditions = [], $responseID = null, $responseData = [])
    {

        // apply tag filter
        if (!empty($_REQUEST['tag'])) {
            // get tag
            if (!$Tag = Tag::getByHandle($_REQUEST['tag'])) {
                return static::throwNotFoundError('Tag not found');
            }

            $conditions[] = 'ID IN (SELECT ContextID FROM tag_items WHERE TagID = '.$Tag->ID.' AND ContextClass = "'.\DB::escape(Person::getStaticRootClass()).'")';
        }


        $responseData['membersTotal'] = Person::getCount();
        $responseData['membersTags']['byTech'] = TagItem::getTagsSummary(array(
            'tagConditions' => array(
                'Handle LIKE "tech.%"'
            )
            ,'itemConditions' => array(
                'ContextClass' => Person::getStaticRootClass()
            )
            ,'limit' => 10
        ));
        $responseData['membersTags']['byTopic'] = TagItem::getTagsSummary(array(
{'fraction_non_alphanumeric': 0.14858670741023683, 'fraction_numerical': 0.0030557677616501145, 'mean_word_length': 2.5975274725274726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '4429543', 'n_tokens_mistral': 727, 'n_tokens_neox': 688, 'n_words': 159}