<commit_before><?php

namespace Tapestry\Entities;

class Url
{
    /**
     * @var Configuration
     */
    private $configuration;

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

    /**
     * Site constructor.
     *
     * @param Configuration $configuration
     */
    public function __construct(Configuration $configuration)
    {
        $this->configuration = $configuration;
    }

    public function parse($uri = '')
    {
        $this->loadSiteUrl();
        $uri = $this->cleanUri($uri);

        $parts = explode('/', $uri);
        foreach ($parts as &$part) {
            if (strpos($part, 'index') !== false) {
                $part = null;
                continue;
            }
            $part = rawurlencode($part);
        }unset($part);

        $parts = array_filter($parts, function($value) {
            return !is_null($value);
        });

        return $this->siteUrl.'/'.implode('/', $parts);<commit_msg>Apply fixes from StyleCI<commit_after><?php

namespace Tapestry\Entities;

class Url
{
    /**
     * @var Configuration
     */
    private $configuration;

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

    /**
     * Site constructor.
     *
     * @param Configuration $configuration
     */
    public function __construct(Configuration $configuration)
    {
        $this->configuration = $configuration;
    }

    public function parse($uri = '')
    {
        $this->loadSiteUrl();
        $uri = $this->cleanUri($uri);

        $parts = explode('/', $uri);
        foreach ($parts as &$part) {
            if (strpos($part, 'index') !== false) {
                $part = null;
                continue;
            }
            $part = rawurlencode($part);
        }
        unset($part);

        $parts = array_filter($parts, function ($value) {
            return ! is_null($value);
        });

        return $this->siteUrl.'/'.implode('/', $parts);
{'fraction_non_alphanumeric': 0.1524896265560166, 'fraction_numerical': 0.0, 'mean_word_length': 1.7755395683453237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2601461', 'n_tokens_mistral': 551, 'n_tokens_neox': 534, 'n_words': 113}