<commit_before><?php

namespace CultuurNet\UDB3\Search;

use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\NullLogger;

class ResultsGenerator implements LoggerAwareInterface, ResultsGeneratorInterface
{
    use LoggerAwareTrait;

    /**
     * Default sorting method because it's ideal for getting consistent paging
     * results.
     */
    const SORT_CREATION_DATE_ASC = 'creationdate asc';

    /**
     * @var SearchServiceInterface
     */
    private $searchService;

    /**
     * @var string
     */
    private $sorting;

    /**
     * @var int
     */
    private $pageSize;

    /**
     * @param SearchServiceInterface $searchService
     * @param string $sorting
     * @param int $pageSize
     */
    public function __construct(
        SearchServiceInterface $searchService,
        $sorting = self::SORT_CREATION_DATE_ASC,
        $pageSize = 10
    ) {
        $this->searchService = $searchService;
        $this->sorting = $sorting;
        $this->pageSize = 10;<commit_msg>III-1807: Actually use the pageSize argument<commit_after><?php

namespace CultuurNet\UDB3\Search;

use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\NullLogger;

class ResultsGenerator implements LoggerAwareInterface, ResultsGeneratorInterface
{
    use LoggerAwareTrait;

    /**
     * Default sorting method because it's ideal for getting consistent paging
     * results.
     */
    const SORT_CREATION_DATE_ASC = 'creationdate asc';

    /**
     * @var SearchServiceInterface
     */
    private $searchService;

    /**
     * @var string
     */
    private $sorting;

    /**
     * @var int
     */
    private $pageSize;

    /**
     * @param SearchServiceInterface $searchService
     * @param string $sorting
     * @param int $pageSize
     */
    public function __construct(
        SearchServiceInterface $searchService,
        $sorting = self::SORT_CREATION_DATE_ASC,
        $pageSize = 10
    ) {
        $this->searchService = $searchService;
        $this->sorting = $sorting;
        $this->pageSize = $pageSize;
{'fraction_non_alphanumeric': 0.09990439770554493, 'fraction_numerical': 0.0057361376673040155, 'mean_word_length': 2.64, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6696079', 'n_tokens_mistral': 637, 'n_tokens_neox': 615, 'n_words': 138}