use MediaWiki\Shell\Shell;
use Wikimedia\ScopedCallback;
use Wikimedia\Rdbms\DBReplicationWaitError;
+use Wikimedia\WrappedString;
/**
* Load an extension
* This function replaces all old wfMsg* functions.
*
* @param string|string[]|MessageSpecifier $key Message key, or array of keys, or a MessageSpecifier
- * @param string[]|string[][] ...$params Normal message parameters
+ * @param string|string[] ...$params Normal message parameters
* @return Message
*
* @since 1.17
* for the first message which is non-empty. If all messages are empty then an
* instance of the first message key is returned.
*
- * @param string[] ...$keys Message keys
+ * @param string ...$keys Message keys
* @return Message
*
* @since 1.18
* If $wgShowHostnames is true, the script will also set 'wgHostname' to the
* hostname of the server handling the request.
*
- * @param string $nonce Value from OutputPage::getCSPNonce
+ * @param string|null $nonce Value from OutputPage::getCSPNonce
* @return string|WrappedString HTML
*/
function wfReportTime( $nonce = null ) {
* As required by the callers, "<nowiki>" is not used.
*
* @param string $text Text to be escaped
+ * @param-taint $text escapes_html
* @return string
*/
function wfEscapeWikiText( $text ) {
* For dealing with nullable timestamp columns in the database.
*
* @param int $outputtype
- * @param string $ts
+ * @param string|null $ts
* @return string
*/
function wfTimestampOrNull( $outputtype = TS_UNIX, $ts = null ) {
* Make directory, and make all parent directories if they don't exist
*
* @param string $dir Full path to directory to create
- * @param int $mode Chmod value to use, default is $wgDirectoryMode
- * @param string $caller Optional caller param for debugging.
+ * @param int|null $mode Chmod value to use, default is $wgDirectoryMode
+ * @param string|null $caller Optional caller param for debugging.
* @throws MWException
* @return bool
*/
// Give site config file a chance to run the script in a wrapper.
// The caller may likely want to call wfBasename() on $script.
Hooks::run( 'wfShellWikiCmd', [ &$script, &$parameters, &$options ] );
- $cmd = isset( $options['php'] ) ? [ $options['php'] ] : [ $wgPhpCli ];
+ $cmd = [ $options['php'] ?? $wgPhpCli ];
if ( isset( $options['wrapper'] ) ) {
$cmd[] = $options['wrapper'];
}
* @param string $mine
* @param string $yours
* @param string &$result
- * @param string &$mergeAttemptResult
+ * @param string|null &$mergeAttemptResult
* @return bool
*/
function wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult = null ) {
* @return string The language code which complying with BCP 47 standards.
*/
function wfBCP47( $code ) {
+ wfDeprecated( __METHOD__, '1.31' );
return LanguageCode::bcp47( $code );
}
*
* @param string $name The image name to check
* @param Title|bool $contextTitle The page on which the image occurs, if known
- * @param string $blacklist Wikitext of a file blacklist
+ * @param string|null $blacklist Wikitext of a file blacklist
* @return bool
*/
function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {