3 declare(strict_types=1);
35 return new Result\Ok($value);
46 return new Result\Error(
$e);
57 if (!$this->colorfactory) {
58 $this->colorfactory =
new Color\Factory();
60 return $this->colorfactory->build($value);
68 public function uri(
string $uri_string):
URI 70 return new URI($uri_string);
82 if (is_string($size)) {
84 if (!preg_match(
"/(\d+)\s*([a-zA-Z]+)/", $size, $match)) {
85 throw new \InvalidArgumentException(
"'$size' can't be interpreted as data size.");
87 return $this->
dataSize((
int) $match[1], $match[2]);
90 throw new \InvalidArgumentException(
91 "Expected second argument to be a unit for data, '$unit' is unknown." 95 return new DataSize($size * $unit_size, $unit_size);
139 return new Range($start, $length);
145 public function order(
string $subject,
string $direction):
Order 147 return new Order($subject, $direction);
161 return new Link($label, $url);
171 if (!$this->dimensionfactory) {
180 public function dataset(array $dimensions): Chart\Dataset
color($value)
Color is a data type representing a color in HTML.
dataset(array $dimensions)
A Link is the often used combination of a label and an URL.
Color expresses a certain color by giving the mixing ratio in the RGB color space.
error($e)
Get an error result.
This class provides the data size with additional information to remove the work to calculate the siz...
A result encapsulates a value or an error and simplifies the handling of those.
A password is used as part of credentials for authentication.
dataSize($size, string $unit=null)
Represents the size of some data.
Both the subject and the direction need to be specified when expressing an order. ...
static array $abbreviations
positiveInteger(int $value)
link(string $label, URI $url)
Dimension Factory $dimensionfactory
The scope of this class is split ilias-conform URI's into components.
Color Factory $colorfactory
cache for color factory.
uri(string $uri_string)
Object representing an uri valid according to RFC 3986 with restrictions imposed on valid characters ...
clientId(string $clientId)
range(int $start, int $length)
order(string $subject, string $direction)
ok($value)
Get an ok result.
A version number that consists of three numbers (major, minor, patch).
A simple class to express a range of whole positive numbers.