final class HtmlText
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

The text primitives every page of the report is written with.

Methods§

public function escape(string $text): string

Text made safe to place inside the document.

Parameters

$textstring

Returns

string
Test cases 1
Called from 93
Calls 1
  • function-call htmlspecialchars line 19
public function chip(string $text, string $role = '', string $title = ''): string

One labelled chip, tinted by the tone named in the class.

Parameters

$textstring
$rolestringThe role classes the chip carries, such as `tone-blue` or `chip-ghost`
$titlestring

Returns

string
Test cases 1
Called from 10
Calls 1
public function chipCount(string $text, string $href, int $count, string $role = ''): string
public function marked(string $name): string

A name with every gap in it marked, the way a gap in a statement is.

Parameters

$namestring

Returns

string
Test cases 1
Called from 2
Calls 2
public function number(int $value): string

A count written the way a reader scans it.

Parameters

$valueint

Returns

string
Test cases 1
Called from 22
Calls 1
  • function-call number_format line 79
public function noun(int $value, string $noun): string
public function plural(int $value, string $noun): string

A count with the noun it counts, singular or plural.

Parameters

$valueint
$nounstring

Returns

string
Test cases 1
Called from 13
Calls 2
public function percent(int $value, int $total): string

A share of a total, as a percentage with no decimals.

Parameters

$valueint
$totalint

Returns

string
Test cases 1
Called from 1
Calls 1
public function collapse(string $text): string

Text with every run of whitespace written as one space.

Parameters

$textstring

Returns

string
Test cases 1
Called from 1
Calls 2
public function truncate(string $text, int $length): string

Text shortened to fit, with an ellipsis where it was cut.

Parameters

$textstring
$lengthint

Returns

string
Test cases 1
Called from 2
Calls 3
public function count(int $value, string $noun = ''): string

A count beside a label, the way a heading carries one.

Parameters

$valueint
$nounstring

Returns

string
Test cases 1
Called from 21
Calls 3

Test cases 33§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 14
Other tests reaching this symbol 19

Relations§

Instantiated in 17
Method calls 193
Type declarations 34