<commit_before><?php
/**
 * This file is part of the League.url library
 *
 * @license http://opensource.org/licenses/MIT
 * @link https://github.com/thephpleague/url/
 * @version 4.0.0
 * @package League.url
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace League\Url\Services;

use League\Url\Interfaces;
use League\Url\Url;

/**
 * an URL Builder to ease URL manipulation
 *
 * @package League.url
 * @since 4.0.0
 */
class Builder
{
    /**
     * Scheme Component
     *
     * @var Url
     */
    protected $url;

    /**
     * Create a new instance of URL
     *
     * @param Url|string $url
     */
    public function __construct($url)
    {
        $this->setUrl($url);
    }

    /**
     * Return an instance of Builder
     *
     * @param Url $url
     *
     * @return static
     */
    protected function newInstance(Interfaces\Url $url)
    {
        if (! $this->url->sameValueAs($url)) {
            $this->url = $url;
        }
        return $this;
    }

    /**
     * Set The URL the builder will use
     * 
     * @param Url|string $url
     * 
     * @return static
     */
    public function setUrl($url)
    {
        if (! $url instanceof Interfaces\Url) {
            $url = Url::createFromUrl($url);
        }
        $this->url = $url;
        
        return $this;
    }

    /**
     * Return the original URL instance
     *
     * @return Url
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * Return an URL with update query values
     *
     * @param Traversable|array $query the data to be merged
     *
     * @return static
     */<commit_msg>Fix Builder docblock<commit_after><?php
/**
 * This file is part of the League.url library
 *
 * @license http://opensource.org/licenses/MIT
 * @link https://github.com/thephpleague/url/
 * @version 4.0.0
 * @package League.url
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace League\Url\Services;

use League\Url\Url;

/**
 * an URL Builder to ease URL manipulation
 *
 * @package League.url
 * @since 4.0.0
 */
class Builder
{
    /**
     * The Url
     *
     * @var Url
     */
    protected $url;

    /**
     * Create a new instance
     *
     * @param Url|string $url
     */
    public function __construct($url)
    {
        $this->setUrl($url);
    }

    /**
     * Return an instance of Builder
     *
     * @param Url $url
     *
     * @return static
     */
    protected function newInstance(Url $url)
    {
        if (! $this->url->sameValueAs($url)) {
            $this->url = $url;
        }
        return $this;
    }

    /**
     * Set The URL the builder will use
     * 
     * @param Url|string $url
     * 
     * @return static
     */
    public function setUrl($url)
    {
        if (! $url instanceof Url) {
            $url = Url::createFromUrl($url);
        }
        $this->url = $url;
        
        return $this;
    }

    /**
     * Return the original URL instance
     *
     * @return Url
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * Return an URL with update query values
     *
     * @param Traversable|array $query the data to be merged
     *
     * @return static
     */
{'fraction_non_alphanumeric': 0.1238964096527369, 'fraction_numerical': 0.003531489111241907, 'mean_word_length': 1.7433414043583535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '205938', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1044, 'n_words': 294}