src/Domain/Value/Identifier/Uri.php
protected static function encodePath(string $path): string
    {
        // http://tools.ietf.org/html/rfc3986#section-3.3
        // path          = path-abempty    ; begins with "/" or is empty
        //               / path-absolute   ; begins with "/" but not "//"
        //               / path-noscheme   ; begins with a non-colon segment
        //               / path-rootless   ; begins with a segment
        //               / path-empty      ; zero characters
        //
        // path-abempty  = *( "/" segment )
        // path-absolute = "/" [ segment-nz *( "/" segment ) ]
        // path-noscheme = segment-nz-nc *( "/" segment )
        // path-rootless = segment-nz *( "/" segment )
        // path-empty    = 0<pchar>
        // segment       = *pchar
        // segment-nz    = 1*pchar
        // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
        //               ; non-zero-length segment without any colon ":"
        // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
        $excluded = static::UNRESERVED_SET.static::SUB_DELIMS_SET.':@\/';

        return static::encode($path, $excluded);
    }
protected static function encodePath(string $path): string
    {
        // http://tools.ietf.org/html/rfc3986#section-3.3
        // path          = path-abempty    ; begins with "/" or is empty
        //               / path-absolute   ; begins with "/" but not "//"
        //               / path-noscheme   ; begins with a non-colon segment
        //               / path-rootless   ; begins with a segment
        //               / path-empty      ; zero characters
        //
        // path-abempty  = *( "/" segment )
        // path-absolute = "/" [ segment-nz *( "/" segment ) ]
        // path-noscheme = segment-nz-nc *( "/" segment )
        // path-rootless = segment-nz *( "/" segment )
        // path-empty    = 0<pchar>
        // segment       = *pchar
        // segment-nz    = 1*pchar
        // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
        //               ; non-zero-length segment without any colon ":"
        // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
        $excluded = static::UNRESERVED_SET.static::SUB_DELIMS_SET.':@\/';

        return static::encode($path, $excluded);
    }
protected static function encodePath ( string $ path ) : string { // http://tools.ietf.org/html/rfc3986#section-3.3 // path          = path-abempty    ; begins with "/" or is empty //               / path-absolute   ; begins with "/" but not "//" //               / path-noscheme   ; begins with a non-colon segment //               / path-rootless   ; begins with a segment //               / path-empty      ; zero characters // // path-abempty  = *( "/" segment ) // path-absolute = "/" [ segment-nz *( "/" segment ) ] // path-noscheme = segment-nz-nc *( "/" segment ) // path-rootless = segment-nz *( "/" segment ) // path-empty    = 0<pchar> // segment       = *pchar // segment-nz    = 1*pchar // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) //               ; non-zero-length segment without any colon ":" // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@" $ excluded = static :: UNRESERVED_SET . static :: SUB_DELIMS_SET . ':@\/' ; return static :: encode ( $ path , $ excluded ) ; }
Encodes the path

@param string $path The path

@return string
Encodes the path