/** * Constructs a suitable checker for given message group. * @param $group MessageGroup */ public function __construct( MessageGroup $group ) { if ( self::$globalBlacklist === null ) { $file = dirname( __FILE__ ) . '/check-blacklist.php'; $list = PHPVariableLoader::loadVariableFromPHPFile( $file, 'checkBlacklist' ); $keys = array( 'group', 'check', 'subcheck', 'code', 'message' ); foreach ( $list as $key => $pattern ) { foreach ( $keys as $checkKey ) { if ( !isset( $pattern[$checkKey] ) ) { $list[$key][$checkKey] = '#'; } elseif ( is_array( $pattern[$checkKey] ) ) { $list[$key][$checkKey] = array_map( array( $this, 'foldValue' ), $pattern[$checkKey] ); } else { $list[$key][$checkKey] = $this->foldValue( $pattern[$checkKey] ); } } } self::$globalBlacklist = $list; } $this->group = $group; }
/** * Checks if the translation uses all variables $[1-9] that the definition * uses and vice versa. * * @param $messages \array Iterable list of TMessage objects. * @param $code \string Language code of the translations. * @param $warnings \array Array where warnings are appended to. */ protected function wikiParameterCheck( $messages, $code, &$warnings ) { return parent::parameterCheck( $messages, $code, $warnings, '/\$[1-9]/' ); }