ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
Description.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\Data\Text;
24 
32 abstract 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 }
getPrimitiveRepresentation(mixed $data)
Each of the types that can be described has a canonical representation created from primitive PHP typ...
This describes some datastructure in terms of standard data structures such as primitives, lists, maps and objects and helpful (hopefully...) human readable texts.
Definition: Description.php:32
__construct(protected ?Text\SimpleDocumentMarkdown $description,)
Definition: Description.php:34