Page MenuHomeWickedGov Phorge

ParsingPlaceholderFactory.php
No OneTemporary

Size
544 B
Referenced Files
None
Subscribers
None

ParsingPlaceholderFactory.php

<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Utilities;
/**
* Create unique placeholders that can be used when parsing (wiki)text.
* @author Niklas Laxström
* @license GPL-2.0-or-later
* @since 2020.07
*/
class ParsingPlaceholderFactory {
/** @var int */
private $i = 0;
/** Return value is guaranteed to only contain [a-zA-Z0-9\x7f] */
public function make(): string {
return "\x7fUNIQ" .
dechex( mt_rand( 0, 0x7fffffff ) ) .
dechex( mt_rand( 0, 0x7fffffff ) ) .
'-' .
$this->i++;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 11:52 (18 h, 5 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e5/7d/602106a08996986cdd97585b3f3b
Default Alt Text
ParsingPlaceholderFactory.php (544 B)

Event Timeline