HtmlWorker

Internal

API still might change

Table of Contents

Constants

REMOVE_ATTR_ON_FAILURE  = 2
Removes corresponding attribute in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `<a>value</a>`
REMOVE_ENCLOSURE_ON_FAILURE  = 4
Removes corresponding enclosure in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `value`
REMOVE_TAG_ON_FAILURE  = 1
Removes corresponding tag in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> ``

Properties

$document  : DOMDocument|null
$linkResultFactory  : LinkResultFactory
$mount  : DOMNode|null
$parser  : HTML5

Methods

__construct()  : mixed
__toString()  : string
parse()  : self
transformUri()  : self
mountFragment()  : DOMNode
onTransformUriFailure()  : void
parseSelector()  : array<string|int, array{node: string, attr: string}>

Constants

REMOVE_ATTR_ON_FAILURE

Removes corresponding attribute in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `<a>value</a>`

public mixed REMOVE_ATTR_ON_FAILURE = 2

REMOVE_ENCLOSURE_ON_FAILURE

Removes corresponding enclosure in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `value`

public mixed REMOVE_ENCLOSURE_ON_FAILURE = 4

REMOVE_TAG_ON_FAILURE

Removes corresponding tag in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> ``

public mixed REMOVE_TAG_ON_FAILURE = 1

Properties

$document

protected DOMDocument|null $document = null

$mount

protected DOMNode|null $mount = null

Methods

__toString()

public __toString() : string
Return values
string

parse()

public parse(string $html) : self
Parameters
$html : string
Return values
self

transformUri()

public transformUri(string $selector[, int $flags = 0 ]) : self
Parameters
$selector : string
$flags : int = 0
Return values
self

mountFragment()

protected mountFragment(DOMDocumentFragment $fragment) : DOMNode
Parameters
$fragment : DOMDocumentFragment
Return values
DOMNode

onTransformUriFailure()

protected onTransformUriFailure(DOMElement $element, array{node: string, attr: string} $subject, int $flags) : void
Parameters
$element : DOMElement

current element encountered failure

$subject : array{node: string, attr: string}

node-attr combination

$flags : int

parseSelector()

protected parseSelector(string $selector) : array<string|int, array{node: string, attr: string}>
Parameters
$selector : string
Return values
array<string|int, array{node: string, attr: string}>

        
On this page

Search results