X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FAction.php;h=6497cab263feca9842c7892a37d9bda152447c7e;hb=81aa6d7a758a000dcd110a2d4d21e50aca6d3444;hp=f288a5cb1f3fa5176fecf004840d663266211e90;hpb=1c29f24dd5833ff2f990556291b5987b6b783e4e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/Action.php b/includes/actions/Action.php index f288a5cb1f..6497cab263 100644 --- a/includes/actions/Action.php +++ b/includes/actions/Action.php @@ -22,7 +22,7 @@ use MediaWiki\MediaWikiServices; /** - * @defgroup Actions Action done on pages + * @defgroup Actions Actions */ /** @@ -101,8 +101,7 @@ abstract class Action implements MessageLocalizer { if ( !class_exists( $classOrCallable ) ) { return false; } - $obj = new $classOrCallable( $page, $context ); - return $obj; + return new $classOrCallable( $page, $context ); } if ( is_callable( $classOrCallable ) ) { @@ -142,7 +141,7 @@ abstract class Action implements MessageLocalizer { } else { $actionName = 'view'; } - } elseif ( $actionName == 'editredlink' ) { + } elseif ( $actionName === 'editredlink' ) { $actionName = 'edit'; } @@ -253,11 +252,12 @@ abstract class Action implements MessageLocalizer { * Get a Message object with context set * Parameters are the same as wfMessage() * + * @param string|string[]|MessageSpecifier $key + * @param mixed ...$params * @return Message */ - final public function msg( $key ) { - $params = func_get_args(); - return $this->getContext()->msg( ...$params ); + final public function msg( $key, ...$params ) { + return $this->getContext()->msg( $key, ...$params ); } /** @@ -359,7 +359,7 @@ abstract class Action implements MessageLocalizer { */ protected function setHeaders() { $out = $this->getOutput(); - $out->setRobotPolicy( "noindex,nofollow" ); + $out->setRobotPolicy( 'noindex,nofollow' ); $out->setPageTitle( $this->getPageTitle() ); $out->setSubtitle( $this->getDescription() ); $out->setArticleRelated( true );