Test Setup Failed
Branch master (0c09a6)
by Stephan
02:31
created

Bootstrap.i18n.php (3 issues)

1
<?php
2
/**
3
 * This is a backwards-compatibility shim, generated by:
4
 * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
5
 *
6
 * Beginning with MediaWiki 1.23, translation strings are stored in json files,
7
 * and the EXTENSION.i18n.php file only exists to provide compatibility with
8
 * older releases of MediaWiki. For more information about this migration, see:
9
 * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
10
 *
11
 * This shim maintains compatibility back to MediaWiki 1.17.
12
 */
13
$messages = array();
14
if ( !function_exists( 'wfJsonI18nShim8d1eb754050adb9a' ) ) {
15
	function wfJsonI18nShim8d1eb754050adb9a( $cache, $code, &$cachedData ) {
0 ignored issues
show
The parameter $cache is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

15
	function wfJsonI18nShim8d1eb754050adb9a( /** @scrutinizer ignore-unused */ $cache, $code, &$cachedData ) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
		$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] );
17
		foreach ( $codeSequence as $csCode ) {
18
			$fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
19
			if ( is_readable( $fileName ) ) {
20
				$data = FormatJson::decode( file_get_contents( $fileName ), true );
0 ignored issues
show
The type FormatJson was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
				foreach ( array_keys( $data ) as $key ) {
22
					if ( $key === '' || $key[0] === '@' ) {
23
						unset( $data[$key] );
24
					}
25
				}
26
				$cachedData['messages'] = array_merge( $data, $cachedData['messages'] );
27
			}
28
29
			$cachedData['deps'][] = new FileDependency( $fileName );
0 ignored issues
show
The type FileDependency was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
30
		}
31
		return true;
32
	}
33
34
	$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim8d1eb754050adb9a';
35
}
36