ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Description.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
32abstract class Description
33{
34 public function __construct(
35 protected ?Text\SimpleDocumentMarkdown $description,
36 ) {
37 }
38
40 {
41 return $this->description;
42 }
43
54 abstract public function getPrimitiveRepresentation(mixed $data): mixed;
55
56 public function matches(mixed $data): bool
57 {
58 if ($this->getPrimitiveRepresentation($data) instanceof \Generator) {
59 return false;
60 }
61
62 return true;
63 }
64}
This describes some datastructure in terms of standard data structures such as primitives,...
Definition: Description.php:33
__construct(protected ?Text\SimpleDocumentMarkdown $description,)
Definition: Description.php:34
getPrimitiveRepresentation(mixed $data)
Each of the types that can be described has a canonical representation created from primitive PHP typ...