ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
Name.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Component\Dependencies
;
22
23
class
Name
24
{
25
private
const
PROPER_NAME_REGEXP
=
"/\w+([\\\\]\w+){2,}/"
;
26
27
public
function
__construct
(
28
protected
string
$name
29
) {
30
if
(!preg_match(self::PROPER_NAME_REGEXP, $this->name)) {
31
throw
new \InvalidArgumentException(
32
"{$this->name} is not a proper name for a dependency."
33
);
34
}
35
}
36
37
public
function
__toString
(): string
38
{
39
return
$this->name;
40
}
41
}
ILIAS\Component\Dependencies\Name
Definition:
Name.php:24
ILIAS\Component\Dependencies\Name\PROPER_NAME_REGEXP
const PROPER_NAME_REGEXP
Definition:
Name.php:25
ILIAS\Component\Dependencies\Name\__construct
__construct(protected string $name)
Definition:
Name.php:27
ILIAS\Component\Dependencies\Name\__toString
__toString()
Definition:
Name.php:37
ILIAS\Component\Dependencies
Definition:
Define.php:21
components
ILIAS
Component
src
Dependencies
Name.php
Generated on Sat Oct 18 2025 23:02:45 for ILIAS by
1.9.4 (using
Doxyfile
)