Documentation

Encoder
in package

FinalYes

Table of Contents

Constants

REGEXP_CHARS_ENCODED  = ',%[A-Fa-f0-9]{2},'
REGEXP_CHARS_INVALID  = '/[\x00-\x1f\x7f]/'
REGEXP_CHARS_PREVENTS_DECODING  = ',% 2[A-F|1-2|4-9]| 3[0-9|B|D]| 4[1-9|A-F]| 5[0-9|A|F]| 6[1-9|A-F]| 7[0-9|E] ,ix'
REGEXP_PART_ENCODED  = '%(?![A-Fa-f\d]{2})'
REGEXP_PART_SUBDELIM  = "\\!\$&'\\(\\)\\*\\+,;\\=%"
REGEXP_PART_UNRESERVED  = 'A-Za-z\d_\-.~'
REGEXP_UNRESERVED_CHARACTERS  = ',%(2[DdEe]|3[0-9]|4[1-9A-Fa-f]|5[AaFf]|6[1-9A-Fa-f]|7[0-9A-Ea-e]),'
Unreserved characters.

Methods

decodeAll()  : string|null
Decodes all the URI component characters.
decodeFragment()  : string|null
Decodes the fragment component while preserving characters that should not be decoded in the context of a full valid URI.
decodeNecessary()  : string|null
Decodes the URI component without decoding the unreserved characters which are already encoded.
decodePartial()  : string|null
Decodes the URI component without decoding the unreserved characters which are already encoded.
decodePath()  : string|null
Decodes the path component while preserving characters that should not be decoded in the context of a full valid URI.
decodeQuery()  : string|null
Decodes the query component while preserving characters that should not be decoded in the context of a full valid URI.
decodeUnreservedCharacters()  : string|null
Decodes the component unreserved characters.
encodePassword()  : string|null
Encode Password.
encodePath()  : string
Encode Path.
encodeQueryKeyValue()  : string|null
encodeQueryOrFragment()  : string|null
Encode Query or Fragment.
encodeUser()  : string|null
Encode User.
encodeUserInfo()  : string|null
isFragmentEncoded()  : bool
Tell whether the query component is correctly encoded.
isPasswordEncoded()  : bool
Tell whether the password component is correctly encoded.
isPathEncoded()  : bool
Tell whether the path component is correctly encoded.
isQueryEncoded()  : bool
Tell whether the query component is correctly encoded.
isUserEncoded()  : bool
Tell whether the user component is correctly encoded.
isUserInfoEncoded()  : bool
Tell whether the userInfo component is correctly encoded.
normalizeFragment()  : string|null
Normalize the fragment component.
normalizeHost()  : string|null
Normalize the host component.
normalizePassword()  : string|null
Normalize password component.
normalizePath()  : string|null
Normalize path component.
normalizeQuery()  : string|null
Normalize the query component.
normalizeUser()  : string|null
Normalize user component.
normalizeUserInfo()  : string|null
decode()  : string|null
Decodes the URI component characters using a closure.
encode()  : string|null
Encodes the URI component characters using a regular expression to find which characters need encoding.
filterComponent()  : string|null
normalize()  : string|null

Constants

REGEXP_CHARS_ENCODED

private mixed REGEXP_CHARS_ENCODED = ',%[A-Fa-f0-9]{2},'

REGEXP_CHARS_INVALID

private mixed REGEXP_CHARS_INVALID = '/[\x00-\x1f\x7f]/'

REGEXP_CHARS_PREVENTS_DECODING

private mixed REGEXP_CHARS_PREVENTS_DECODING = ',% 2[A-F|1-2|4-9]| 3[0-9|B|D]| 4[1-9|A-F]| 5[0-9|A|F]| 6[1-9|A-F]| 7[0-9|E] ,ix'

REGEXP_PART_ENCODED

private mixed REGEXP_PART_ENCODED = '%(?![A-Fa-f\d]{2})'

REGEXP_PART_SUBDELIM

private mixed REGEXP_PART_SUBDELIM = "\\!\$&'\\(\\)\\*\\+,;\\=%"

REGEXP_PART_UNRESERVED

private mixed REGEXP_PART_UNRESERVED = 'A-Za-z\d_\-.~'

Methods

decodeAll()

Decodes all the URI component characters.

public static decodeAll(BackedEnum|Stringable|string|null $component) : string|null
Parameters
$component : BackedEnum|Stringable|string|null
Return values
string|null

decodeFragment()

Decodes the fragment component while preserving characters that should not be decoded in the context of a full valid URI.

public static decodeFragment(BackedEnum|Stringable|string|null $path) : string|null
Parameters
$path : BackedEnum|Stringable|string|null
Return values
string|null

decodeNecessary()

Decodes the URI component without decoding the unreserved characters which are already encoded.

public static decodeNecessary(BackedEnum|Stringable|string|int|null $component) : string|null
Parameters
$component : BackedEnum|Stringable|string|int|null
Return values
string|null

decodePartial()

Decodes the URI component without decoding the unreserved characters which are already encoded.

public static decodePartial(BackedEnum|Stringable|string|int|null $component) : string|null

Since version 7.6.0

use League\Uri\Encoder::decodeNecessary() instead

DEPRECATION WARNING! This method will be removed in the next major point release.

Parameters
$component : BackedEnum|Stringable|string|int|null
Tags
codeCoverageIgnore
see
Encoder::decodeNecessary()

Create a new instance from the environment.

Return values
string|null

decodePath()

Decodes the path component while preserving characters that should not be decoded in the context of a full valid URI.

public static decodePath(BackedEnum|Stringable|string|null $path) : string|null
Parameters
$path : BackedEnum|Stringable|string|null
Return values
string|null

decodeQuery()

Decodes the query component while preserving characters that should not be decoded in the context of a full valid URI.

public static decodeQuery(BackedEnum|Stringable|string|null $path) : string|null
Parameters
$path : BackedEnum|Stringable|string|null
Return values
string|null

decodeUnreservedCharacters()

Decodes the component unreserved characters.

public static decodeUnreservedCharacters(BackedEnum|Stringable|string|null $str) : string|null
Parameters
$str : BackedEnum|Stringable|string|null
Return values
string|null

encodePassword()

Encode Password.

public static encodePassword(BackedEnum|Stringable|string|null $component) : string|null

Generic delimiters ":" MUST NOT be encoded

Parameters
$component : BackedEnum|Stringable|string|null
Return values
string|null

encodePath()

Encode Path.

public static encodePath(BackedEnum|Stringable|string|null $component) : string

Generic delimiters ":", "@", and "/" MUST NOT be encoded

Parameters
$component : BackedEnum|Stringable|string|null
Return values
string

encodeQueryKeyValue()

public static encodeQueryKeyValue(mixed $component) : string|null
Parameters
$component : mixed
Return values
string|null

encodeQueryOrFragment()

Encode Query or Fragment.

public static encodeQueryOrFragment(BackedEnum|Stringable|string|null $component) : string|null

Generic delimiters ":", "@", "?", and "/" MUST NOT be encoded

Parameters
$component : BackedEnum|Stringable|string|null
Return values
string|null

encodeUser()

Encode User.

public static encodeUser(BackedEnum|Stringable|string|null $user) : string|null

All generic delimiters MUST be encoded

Parameters
$user : BackedEnum|Stringable|string|null
Return values
string|null

encodeUserInfo()

public static encodeUserInfo(BackedEnum|Stringable|string|null $userInfo) : string|null
Parameters
$userInfo : BackedEnum|Stringable|string|null
Return values
string|null

isFragmentEncoded()

Tell whether the query component is correctly encoded.

public static isFragmentEncoded(BackedEnum|Stringable|string|null $encoded) : bool
Parameters
$encoded : BackedEnum|Stringable|string|null
Return values
bool

isPasswordEncoded()

Tell whether the password component is correctly encoded.

public static isPasswordEncoded(BackedEnum|Stringable|string|null $encoded) : bool
Parameters
$encoded : BackedEnum|Stringable|string|null
Return values
bool

isPathEncoded()

Tell whether the path component is correctly encoded.

public static isPathEncoded(BackedEnum|Stringable|string|null $encoded) : bool
Parameters
$encoded : BackedEnum|Stringable|string|null
Return values
bool

isQueryEncoded()

Tell whether the query component is correctly encoded.

public static isQueryEncoded(BackedEnum|Stringable|string|null $encoded) : bool
Parameters
$encoded : BackedEnum|Stringable|string|null
Return values
bool

isUserEncoded()

Tell whether the user component is correctly encoded.

public static isUserEncoded(BackedEnum|Stringable|string|null $encoded) : bool
Parameters
$encoded : BackedEnum|Stringable|string|null
Return values
bool

isUserInfoEncoded()

Tell whether the userInfo component is correctly encoded.

public static isUserInfoEncoded(BackedEnum|Stringable|string|null $userInfo) : bool
Parameters
$userInfo : BackedEnum|Stringable|string|null
Return values
bool

normalizeFragment()

Normalize the fragment component.

public static normalizeFragment(BackedEnum|Stringable|string|null $fragment) : string|null

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986.

Parameters
$fragment : BackedEnum|Stringable|string|null
Return values
string|null

normalizeHost()

Normalize the host component.

public static normalizeHost(BackedEnum|Stringable|string|null $host) : string|null
Parameters
$host : BackedEnum|Stringable|string|null
Tags
see
https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.2

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986.

Return values
string|null

normalizePassword()

Normalize password component.

public static normalizePassword(BackedEnum|Stringable|string|null $password) : string|null

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986.

Parameters
$password : BackedEnum|Stringable|string|null
Return values
string|null

normalizePath()

Normalize path component.

public static normalizePath(BackedEnum|Stringable|string|null $component) : string|null

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986.

Parameters
$component : BackedEnum|Stringable|string|null
Return values
string|null

normalizeQuery()

Normalize the query component.

public static normalizeQuery(BackedEnum|Stringable|string|null $query) : string|null

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986.

Parameters
$query : BackedEnum|Stringable|string|null
Return values
string|null

normalizeUser()

Normalize user component.

public static normalizeUser(BackedEnum|Stringable|string|null $user) : string|null

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986.

Parameters
$user : BackedEnum|Stringable|string|null
Return values
string|null

normalizeUserInfo()

public static normalizeUserInfo(BackedEnum|Stringable|string|null $userInfo) : string|null
Parameters
$userInfo : BackedEnum|Stringable|string|null
Return values
string|null

decode()

Decodes the URI component characters using a closure.

private static decode(BackedEnum|Stringable|string|int|null $component, Closure $decoder) : string|null
Parameters
$component : BackedEnum|Stringable|string|int|null
$decoder : Closure
Return values
string|null

encode()

Encodes the URI component characters using a regular expression to find which characters need encoding.

private static encode(BackedEnum|Stringable|string|int|bool|null $component, string $pattern) : string|null
Parameters
$component : BackedEnum|Stringable|string|int|bool|null
$pattern : string
Return values
string|null

filterComponent()

private static filterComponent(mixed $component) : string|null
Parameters
$component : mixed
Return values
string|null

normalize()

private static normalize(string|null $component) : string|null
Parameters
$component : string|null
Return values
string|null

        
On this page

Search results