ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
PluralFormKey.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Language\ComponentTranslation
;
22
31
final
class
PluralFormKey
32
{
33
public
static
function
of
(
string
$identifier,
int
$form): string
34
{
35
return
sprintf(
'%s [%d]'
, $identifier, $form);
36
}
37
41
public
static
function
parse
(
string
$key): ?array
42
{
43
if
(preg_match(
'/\A(.+) \[(0|[1-9]\d?)\]\z/s'
, $key, $matches) !== 1) {
44
return
null
;
45
}
46
47
return
[$matches[1], (
int
) $matches[2]];
48
}
49
}
ILIAS\Language\ComponentTranslation\PluralFormKey
A form of a plural message of a migrated module in a flat identifier => value map (admin GUI rows,...
Definition:
PluralFormKey.php:32
ILIAS\Language\ComponentTranslation\PluralFormKey\of
static of(string $identifier, int $form)
Definition:
PluralFormKey.php:33
ILIAS\Language\ComponentTranslation\PluralFormKey\parse
static parse(string $key)
Definition:
PluralFormKey.php:41
ILIAS\Language\ComponentTranslation
Definition:
AtomicFileWriter.php:21
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
components
ILIAS
Language
src
ComponentTranslation
PluralFormKey.php
Generated on Wed Nov 11 2026 23:07:34 for ILIAS by
1.9.4 (using
Doxyfile
)