Documentation

DataPathInterface extends PathInterface

Table of Contents

__toString()  : string
Returns the instance string representation.
decoded()  : string
Returns the decoded path.
getContent()  : string|null
Returns the instance content.
getData()  : string
Retrieves the data string.
getMediaType()  : string
Retrieve the mediatype associated with the URI.
getMimeType()  : string
Retrieve the data mime type associated to the URI.
getParameters()  : string
Retrieve the parameters associated with the Mime Type of the URI.
getUriComponent()  : string
Returns the instance string representation with its optional URI delimiters.
hasTrailingSlash()  : bool
Returns whether or not the path has a trailing delimiter.
isAbsolute()  : bool
Returns whether or not the path is absolute or relative.
isBinaryData()  : bool
Tells whether the data is binary safe encoded.
jsonSerialize()  : string|null
Returns the instance json representation.
save()  : SplFileObject
Save the data to a specific file.
toAscii()  : self
Returns an instance where the data part is url encoded following RFC3986 rules.
toBinary()  : self
Returns an instance where the data part is base64 encoded.
withContent()  : self
Returns an instance with the specified content.
withLeadingSlash()  : self
Returns an instance with a leading slash.
withoutDotSegments()  : self
Returns an instance without dot segments.
withoutLeadingSlash()  : self
Returns an instance without a leading slash.
withoutTrailingSlash()  : self
Returns an instance without a trailing slash.
withParameters()  : self
Return an instance with the specified mediatype parameters.
withTrailingSlash()  : self
Returns an instance with a trailing slash.

Methods

__toString()

Returns the instance string representation.

public __toString() : string

If the instance is defined, 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, Sections 2 and 3.

If the instance is not defined an empty string is returned

Return values
string

decoded()

Returns the decoded path.

public decoded() : string
Return values
string

getContent()

Returns the instance content.

public getContent() : string|null

If the instance is defined, the value returned MUST be encoded according to the selected encoding algorithm. In any case, the value MUST NOT double-encode any character depending on the selected encoding algorithm.

To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3. or RFC 3987 Section 3. By default the content is encoded according to RFC3986

If the instance is not defined null is returned

Return values
string|null

getData()

Retrieves the data string.

public getData() : string

Retrieves the data part of the path. If no data part is provided return a empty string

Return values
string

getUriComponent()

Returns the instance string representation with its optional URI delimiters.

public getUriComponent() : string

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, Sections 2 and 3.

If the instance is not defined an empty string is returned

Return values
string

hasTrailingSlash()

Returns whether or not the path has a trailing delimiter.

public hasTrailingSlash() : bool
Return values
bool

isAbsolute()

Returns whether or not the path is absolute or relative.

public isAbsolute() : bool
Return values
bool

isBinaryData()

Tells whether the data is binary safe encoded.

public isBinaryData() : bool
Return values
bool

jsonSerialize()

Returns the instance json representation.

public jsonSerialize() : string|null

If the instance is defined, 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 or RFC 1738.

If the instance is not defined null is returned

Return values
string|null

save()

Save the data to a specific file.

public save(string $path[, string $mode = 'w' ]) : SplFileObject
Parameters
$path : string
$mode : string = 'w'
Return values
SplFileObject

toAscii()

Returns an instance where the data part is url encoded following RFC3986 rules.

public toAscii() : self

This method MUST retain the state of the current instance, and return an instance where the data part is url encoded

Return values
self

toBinary()

Returns an instance where the data part is base64 encoded.

public toBinary() : self

This method MUST retain the state of the current instance, and return an instance where the data part is base64 encoded

Return values
self

withContent()

Returns an instance with the specified content.

public withContent(string|null $content) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified content.

Users can provide both encoded and decoded content characters.

A null value is equivalent to removing the component content.

Parameters
$content : string|null
Tags
throws
SyntaxError

for invalid component or transformations that would result in a object in invalid state.

throws
IdnSupportMissing

for component or transformations requiring IDN support when IDN support is not present or misconfigured.

Return values
self

withLeadingSlash()

Returns an instance with a leading slash.

public withLeadingSlash() : self

This method MUST retain the state of the current instance, and return an instance that contains the path component with a leading slash

Tags
throws
SyntaxError

for invalid component or transformations that would result in a object in invalid state.

Return values
self

withoutDotSegments()

Returns an instance without dot segments.

public withoutDotSegments() : self

This method MUST retain the state of the current instance, and return an instance that contains the path component normalized by removing the dot segment.

Tags
throws
SyntaxError

for invalid component or transformations that would result in a object in invalid state.

Return values
self

withoutLeadingSlash()

Returns an instance without a leading slash.

public withoutLeadingSlash() : self

This method MUST retain the state of the current instance, and return an instance that contains the path component without a leading slash

Tags
throws
SyntaxError

for invalid component or transformations that would result in a object in invalid state.

Return values
self

withoutTrailingSlash()

Returns an instance without a trailing slash.

public withoutTrailingSlash() : self

This method MUST retain the state of the current instance, and return an instance that contains the path component without a trailing slash

Tags
throws
SyntaxError

for invalid component or transformations that would result in a object in invalid state.

Return values
self

withParameters()

Return an instance with the specified mediatype parameters.

public withParameters(string $parameters) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified mediatype parameters.

Users must provide encoded characters.

An empty parameters value is equivalent to removing the parameter.

Parameters
$parameters : string
Return values
self

withTrailingSlash()

Returns an instance with a trailing slash.

public withTrailingSlash() : self

This method MUST retain the state of the current instance, and return an instance that contains the path component with a trailing slash

Tags
throws
SyntaxError

for invalid component or transformations that would result in a object in invalid state.

Return values
self

Search results