<commit_before><?php

namespace OpenCFP\Domain\Entity\Mapper;

use Spot\Mapper;

class Talk extends Mapper
{
    /**
     * Column Sort By White List
     * @var array
     */
    protected $order_by_whitelist = [
        'created_at',
        'title',
        'type',
        'category',
    ];

    /**
     * Return an array of talks for use by PagerFanta where we set the
     * value in the favorite based on whether or not the current admin
     * user has favourited this talk
     *
     * @param integer $admin_user_id
     * @param array $options
     * @return array If order by is not in white list
     * @internal param string $order_by
     * @internal param string $sort Sort Direction
     */
    public function getAllPagerFormatted($admin_user_id, $sort, $userData = true, $where = null)
    {
        // Merge options with default options
        $options = $this->getSortOptions(
            $options,
            [
                'order_by' => 'created_at',
                'sort' => 'ASC',
            ]
        );

        $talks = $this->all()
            ->order([$options['order_by'] => $options['sort']])
            ->with(['favorites', 'comments']);
        $formatted = [];

        if ($where) {
            $talks = $this->all()
                ->order($sort)
                ->where($where);
        } else {
            $talks = $this->all()
                ->order($sort)
                ->with(['favorites']);
        }
<commit_msg>Patch incomplete refactor of $options to $sort<commit_after><?php

namespace OpenCFP\Domain\Entity\Mapper;

use Spot\Mapper;

class Talk extends Mapper
{
    /**
     * Column Sort By White List
     * @var array
     */
    protected $order_by_whitelist = [
        'created_at',
        'title',
        'type',
        'category',
    ];

    /**
     * Return an array of talks for use by PagerFanta where we set the
     * value in the favorite based on whether or not the current admin
     * user has favourited this talk
     *
     * @param integer $admin_user_id
     * @param array $options
     * @return array If order by is not in white list
     * @internal param string $order_by
     * @internal param string $sort Sort Direction
     */
    public function getAllPagerFormatted($admin_user_id, $options, $userData = true, $where = null)
    {
        // Merge options with default options
        $options = $this->getSortOptions(
            $options,
            [
                'order_by' => 'created_at',
                'sort' => 'ASC',
            ]
        );

        $talks = $this->all()
            ->order([$options['order_by'] => $options['sort']])
            ->with(['favorites', 'comments']);
        $formatted = [];

        if ($where) {
            $talks = $this->all()
                ->order([$options['order_by'] => $options['sort']])
                ->where($where);
        } else {
            $talks = $this->all()
                ->order([$options['order_by'] => $options['sort']])
                ->with(['favorites']);
        }

{'fraction_non_alphanumeric': 0.13245901639344262, 'fraction_numerical': 0.0, 'mean_word_length': 1.7660924750679963, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '5270036', 'n_tokens_mistral': 879, 'n_tokens_neox': 861, 'n_words': 240}