19declare(strict_types=1);
52 return new Result\Ok($value);
74 if (!$this->colorfactory) {
77 return $this->colorfactory->build($value);
85 public function uri(
string $uri_string):
URI
87 return new URI($uri_string);
99 if (is_string($size)) {
101 if (!preg_match(
"/(\d+)\s*([a-zA-Z]+)/", $size, $match)) {
102 throw new \InvalidArgumentException(
"'$size' can't be interpreted as data size.");
104 return $this->
dataSize((
int) $match[1], $match[2]);
107 throw new \InvalidArgumentException(
108 "Expected second argument to be a unit for data, '$unit' is unknown."
112 return new DataSize($size * $unit_size, $unit_size);
156 return new Range($start, $length);
162 public function order(
string $subject,
string $direction):
Order
164 return new Order($subject, $direction);
188 if (!$this->dimensionfactory) {
198 public function dataset(array $dimensions, array $dimension_groups = []):
Chart\Dataset
205 if (
null === $this->html_metadata_factory) {
214 if (
null === $this->open_graph_metadata_factory) {
228 if ($this->text_factory ===
null) {
229 $md_format = new \ILIAS\Refinery\String\MarkdownFormattingToHTML();
230 $this->text_factory = new \ILIAS\Data\Text\Factory(
231 new Text\MarkdownFactory(
232 new Text\Shape\Markdown($md_format),
233 new Text\Shape\SimpleDocumentMarkdown($md_format),
234 new Text\Shape\WordOnlyMarkdown($md_format)
243 if ($this->description_factory ===
null) {
244 $this->description_factory =
new Description\Factory();
Builds a Color from either hex- or rgb values.
Color expresses a certain color by giving the mixing ratio in the RGB color space.
This class provides the data size with additional information to remove the work to calculate the siz...
static array $abbreviations
This describes some datastructure in terms of standard data structures such as primitives,...
positiveInteger(int $value)
Dimension Factory $dimensionfactory
Color Factory $colorfactory
color($value)
Color is a data type representing a color in HTML.
range(int $start, int $length)
clientId(string $clientId)
dataset(array $dimensions, array $dimension_groups=[])
link(string $label, URI $url)
Meta Html Factory $html_metadata_factory
order(string $subject, string $direction)
Meta Html OpenGraph Factory $open_graph_metadata_factory
ok($value)
Get an ok result.
dataSize($size, ?string $unit=null)
Represents the size of some data.
Text Factory $text_factory
Description Factory $description_factory
error($e)
Get an error result.
uri(string $uri_string)
Object representing an uri valid according to RFC 3986 with restrictions imposed on valid characters ...
languageTag(string $language_tag)
This class represents a valid language tag that should be used instead of plain strings.
static fromString(string $string)
A Link is the often used combination of a label and an URL.
Both the subject and the direction need to be specified when expressing an order.
A password is used as part of credentials for authentication.
A simple class to express a naive range of whole positive numbers.
The scope of this class is split ilias-conform URI's into components.
A version number that consists of three numbers (major, minor, patch).
A result encapsulates a value or an error and simplifies the handling of those.