Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5984063
ReplayMinifierState.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ReplayMinifierState.php
View Options
<?php
// @phan-file-suppress PhanPluginNeverReturnMethod
namespace
MediaWiki\ResourceLoader
;
use
LogicException
;
use
Wikimedia\Minify\MinifierState
;
/**
* Fake minifier that buffers additions to later replay to multiple another minifiers.
*
* This exists for ResourceLoader::getOneModuleResponse() to pass module content
* through both IdentityMinifierState and JavaScriptMinifierState/JavaScriptMapperState
* without building the same module twice.
*
* @internal
*/
class
ReplayMinifierState
extends
MinifierState
{
protected
array
$calls
=
[];
/**
* Replay all supported method calls from this minifier on another minifier.
*/
public
function
replayOn
(
MinifierState
$otherMinifier
):
void
{
foreach
(
$this
->
calls
as
[
$method
,
$args
]
)
{
$otherMinifier
->
$method
(
...
$args
);
}
}
/** @inheritDoc */
public
function
outputFile
(
string
$file
)
{
$this
->
calls
[]
=
[
__FUNCTION__
,
func_get_args
()
];
return
$this
;
}
/** @inheritDoc */
public
function
sourceRoot
(
string
$url
)
{
throw
new
LogicException
(
"Not implemented"
);
}
/** @inheritDoc */
public
function
addSourceFile
(
string
$url
,
string
$source
,
bool
$bundle
=
false
)
{
$this
->
calls
[]
=
[
__FUNCTION__
,
func_get_args
()
];
return
$this
;
}
/** @inheritDoc */
public
function
setErrorHandler
(
$onError
)
{
throw
new
LogicException
(
"Not implemented"
);
}
/** @inheritDoc */
protected
function
minify
(
string
$source
):
string
{
throw
new
LogicException
(
"Not implemented"
);
}
/** @inheritDoc */
public
function
addOutput
(
string
$output
)
{
$this
->
calls
[]
=
[
__FUNCTION__
,
func_get_args
()
];
return
$this
;
}
/** @inheritDoc */
public
function
ensureNewline
()
{
$this
->
calls
[]
=
[
__FUNCTION__
,
func_get_args
()
];
return
$this
;
}
/** @inheritDoc */
public
function
getMinifiedOutput
()
{
throw
new
LogicException
(
"Not implemented"
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 23:10 (1 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
02/62/6d5770d3c247054a020b04d7934c
Default Alt Text
ReplayMinifierState.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment