ILIAS
trunk Revision v12.0_alpha-377-g3641b37b9db
◀ ilDoc Overview
Username.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\ApacheAuth\UsernameProvider
;
22
23
final
readonly
class
Username
implements
UsernameInterface
24
{
25
public
function
__construct
(
private
string
$username)
26
{
27
if
(trim($username) ===
''
) {
28
throw
new \InvalidArgumentException(
'Username cannot be empty'
);
29
}
30
}
31
32
public
function
asString
(): string
33
{
34
return
$this->
__toString
();
35
}
36
37
public
function
isEmpty
(): bool
38
{
39
return
false
;
40
}
41
42
public
function
__toString
(): string
43
{
44
return
$this->username;
45
}
46
}
ILIAS\ApacheAuth\UsernameProvider\Username
Definition:
Username.php:24
ILIAS\ApacheAuth\UsernameProvider\Username\isEmpty
isEmpty()
True if this represents an empty (non-real) username.
Definition:
Username.php:37
ILIAS\ApacheAuth\UsernameProvider\Username\asString
asString()
Returns the username as string.
Definition:
Username.php:32
ILIAS\ApacheAuth\UsernameProvider\Username\__construct
__construct(private string $username)
Definition:
Username.php:25
ILIAS\ApacheAuth\UsernameProvider\Username\__toString
__toString()
Definition:
Username.php:42
ILIAS\ApacheAuth\UsernameProvider\UsernameInterface
Implementations may represent a resolved, concrete username or a null/empty value.
Definition:
UsernameInterface.php:27
ILIAS\ApacheAuth\UsernameProvider
Definition:
CollectUsernameProvidersObjective.php:21
components
ILIAS
AuthApache
src
UsernameProvider
Username.php
Generated on Sun Dec 14 2025 23:01:47 for ILIAS by
1.9.4 (using
Doxyfile
)