MediaWiki
master
ReadableNumericSerialMapping.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\User\TempUser
;
4
10
class
ReadableNumericSerialMapping
implements
SerialMapping
{
11
private
int
$offset;
12
16
public
function
__construct
( $config ) {
17
$this->offset = $config[
'offset'
] ?? 0;
18
}
19
20
public
function
getSerialIdForIndex
(
int
$index ): string {
21
$mapped = (string)( $index + $this->offset );
22
return
rtrim( chunk_split( $mapped, 5,
'-'
),
'-'
);
23
}
24
}
MediaWiki\User\TempUser\ReadableNumericSerialMapping
Simple serial mapping for ASCII decimal numbers with hyphens for readability.
Definition
ReadableNumericSerialMapping.php:10
MediaWiki\User\TempUser\ReadableNumericSerialMapping\getSerialIdForIndex
getSerialIdForIndex(int $index)
Definition
ReadableNumericSerialMapping.php:20
MediaWiki\User\TempUser\ReadableNumericSerialMapping\__construct
__construct( $config)
Definition
ReadableNumericSerialMapping.php:16
MediaWiki\User\TempUser\SerialMapping
Interface for integer to string mappings for temporary user autocreation.
Definition
SerialMapping.php:10
MediaWiki\User\TempUser
Definition
CreateStatus.php:3
includes
user
TempUser
ReadableNumericSerialMapping.php
Generated on Sun Dec 22 2024 01:26:50 for MediaWiki by
1.10.0