<commit_before><?php

namespace Rougin\Weasley\Integrations\Illuminate;

use Rougin\Slytherin\Integration\Configuration;
use Rougin\Slytherin\Container\ContainerInterface;

use Illuminate\Pagination\Paginator;

/**
 * Illuminate's Pagination Integration
 *
 * An integration for Laravel's Pagination package (illuminate/pagination).
 *
 * @package Weasley
 * @author  <NAME> <<EMAIL>>
 */
class PaginationIntegration implements \Rougin\Slytherin\Integration\IntegrationInterface
{
    /**
     * Defines the specified integration.
     *
     * @param  \Rougin\Slytherin\Container\ContainerInterface $container
     * @param  \Rougin\Slytherin\Integration\Configuration    $config
     * @return \Rougin\Slytherin\Container\ContainerInterface
     */
    public function define(ContainerInterface $container, Configuration $config)
    {
        $request = $container->get('Psr\Http\Message\ServerRequestInterface');

        $response = $container->get('Psr\Http\Message\ResponseInterface');

        if (method_exists('Illuminate\Pagination\Paginator', 'currentPathResolver')) {
            Paginator::currentPathResolver(function () use ($request) {
                $uri = $request->getAttribute('REQUEST_URI');

                return isset($uri) ? strtok($uri, '?') : '/';
            });
        }

        if (method_exists('Illuminate\Pagination\Paginator', 'currentPathResolver')) {
            Paginator::currentPageResolver(function ($name = null) use ($request) {
                list($page, $parameters) = array($name ?: 'page', $request->getQueryParams());

                return isset($parameters[$name]) ? $parameters[$name] : 1;
            });
        }

        return $container;
    }
}<commit_msg>Update PaginationIntegration<commit_after><?php

namespace Rougin\Weasley\Integrations\Illuminate;

use Rougin\Slytherin\Integration\Configuration;
use Rougin\Slytherin\Container\ContainerInterface;

use Illuminate\Pagination\Paginator;

/**
 * Illuminate's Pagination Integration
 *
 * An integration for Laravel's Pagination package (illuminate/pagination).
 *
 * @package Weasley
 * @author  <NAME> <<EMAIL>>
 */
class PaginationIntegration implements \Rougin\Slytherin\Integration\IntegrationInterface
{
    /**
     * Defines the specified integration.
     *
     * @param  \Rougin\Slytherin\Container\ContainerInterface $container
     * @param  \Rougin\Slytherin\Integration\Configuration    $config
     * @return \Rougin\Slytherin\Container\ContainerInterface
     */
    public function define(ContainerInterface $container, Configuration $config)
    {
        $request = $container->get('Psr\Http\Message\ServerRequestInterface');

        $response = $container->get('Psr\Http\Message\ResponseInterface');

        Paginator::currentPathResolver(function () use ($request) {
            $uri = $request->getAttribute('REQUEST_URI');

            return isset($uri) ? strtok($uri, '?') : '/';
        });

        Paginator::currentPageResolver(function ($name = null) use ($request) {
            list($page, $parameters) = array($name ?: 'page', $request->getQueryParams());

            return isset($parameters[$name]) ? $parameters[$name] : 1;
        });

        return $container;
    }
}
{'fraction_non_alphanumeric': 0.13131000309693402, 'fraction_numerical': 0.0006193868070610096, 'mean_word_length': 3.4005449591280654, 'pattern_counts': {'":': 0, '<': 11, '<?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': '4638927', 'n_tokens_mistral': 918, 'n_tokens_neox': 925, 'n_words': 155}