/**
* Things that were formerly globals and should still be converted
*
- * @var array
+ * @var string[]
*/
protected $formerGlobals = [
'TrackingCategories',
/**
* No longer supported globals (with reason) should not be converted and emit a warning
*
- * @var array
+ * @var string[]
*/
protected $noLongerSupportedGlobals = [
'SpecialPageGroups' => 'deprecated', // Deprecated 1.21, removed in 1.26
/**
* Keys that should be put at the top of the generated JSON file (T86608)
*
- * @var array
+ * @var string[]
*/
protected $promote = [
'name',
$this->fatalError( "Error: Closures cannot be converted to JSON. " .
"Please move your extension function somewhere else."
);
- }
- // check if $func exists in the global scope
- if ( function_exists( $func ) ) {
+ } elseif ( function_exists( $func ) ) {
+ // check if $func exists in the global scope
$this->fatalError( "Error: Global functions cannot be converted to JSON. " .
"Please move your extension function ($func) into a class."
);
$this->fatalError( "Error: Closures cannot be converted to JSON. " .
"Please move the handler for $hookName somewhere else."
);
- }
- // Check if $func exists in the global scope
- if ( function_exists( $func ) ) {
+ } elseif ( function_exists( $func ) ) {
+ // Check if $func exists in the global scope
$this->fatalError( "Error: Global functions cannot be converted to JSON. " .
"Please move the handler for $hookName inside a class."
);
$this->json[$realName] = $value;
}
+ /**
+ * @param string $realName
+ * @param array[] $value
+ * @suppress PhanTypeInvalidDimOffset
+ */
protected function handleResourceModules( $realName, $value ) {
$defaults = [];
$remote = $this->hasOption( 'skin' ) ? 'remoteSkinPath' : 'remoteExtPath';