for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* League.Uri (http://uri.thephpleague.com)
*
* @package League.uri
* @author Ignace Nyamagana Butera <[email protected]>
* @copyright 2013-2015 Ignace Nyamagana Butera
* @license https://github.com/thephpleague/uri/blob/master/LICENSE (MIT License)
* @version 4.1.0
* @link https://github.com/thephpleague/uri/
*/
namespace League\Uri\Components;
use League\Uri\Interfaces\Path as PathInterface;
* Value object representing a URI path component.
* @since 1.0.0
class Path extends AbstractComponent implements PathInterface
{
use PathTrait;
* @inheritdoc
protected static $reservedCharactersRegex = "\!\$&'\(\)\*\+,;\=\:\/@\?%";
protected static $invalidCharactersRegex = ',[?#],';
* new instance
* @param string $path the component value
public function __construct($path = '')
parent::__construct($this->validateString($path));
}
* validate the submitted data
* @param string $path
* @return string
protected function validate($path)
$this->assertValidComponent($path);
return preg_replace_callback(
'/(?:[^'.static::$reservedCharactersRegex.']+|%(?![A-Fa-f0-9]{2}))/S',
[$this, 'decodeSegmentPart'],
$path
);