ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
HelpScreenId.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28#[\Attribute(\Attribute::TARGET_CLASS)]
30{
31 public function __construct(private string $screen_id)
32 {
33 // $screen id can only constist of lowercase letters and underscores. Otherwise, a InvalidArgumentException is thrown.
34 if (!preg_match('/^[a-z0-9_]+$/', $screen_id)) {
35 throw new \InvalidArgumentException('Screen name must only consist of lowercase letters, numbers and underscores.');
36 }
37 }
38
39 public function getScreenId(): string
40 {
41 return $this->screen_id;
42 }
43}
__construct(private string $screen_id)