ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ 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\__toString
__toString()
Definition:
Name.php:37
ILIAS\Component\Dependencies\Name\__construct
__construct(protected string $name)
Definition:
Name.php:27
ILIAS\Component\Dependencies\Name
Definition:
Name.php:23
ILIAS\Component\Dependencies\Name\PROPER_NAME_REGEXP
const PROPER_NAME_REGEXP
Definition:
Name.php:25
ILIAS\Component\Dependencies
Definition:
Define.php:21
components
ILIAS
Component
src
Dependencies
Name.php
Generated on Mon Sep 1 2025 23:02:39 for ILIAS by
1.8.13 (using
Doxyfile
)