Tweaks in API code per code review

Follow-up to If5c8d95560cbb078ae4980f4a912cbaeafe53d3e.

Change-Id: Iff72b5b21c0f5ce6a45cc48d6a8fc060159d7d23
This commit is contained in:
Bartosz Dziewoński 2020-05-19 19:53:29 +02:00
parent 97b2547daf
commit 63638e380d
2 changed files with 7 additions and 5 deletions

View file

@ -9,6 +9,8 @@
*/
use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
trait ApiParsoidTrait {
@ -18,19 +20,19 @@ trait ApiParsoidTrait {
protected $serviceClient = null;
/**
* @var \Psr\Log\LoggerInterface
* @var LoggerInterface
*/
protected $logger = null;
/**
* @return \Psr\Log\LoggerInterface
* @return LoggerInterface
*/
protected function getLogger() {
return $this->logger ?: new \Psr\Log\NullLogger();
return $this->logger ?: new NullLogger();
}
/**
* @param \Psr\Log\LoggerInterface $logger
* @param LoggerInterface $logger
*/
protected function setLogger( $logger ) {
$this->logger = $logger;

View file

@ -15,8 +15,8 @@ use MediaWiki\Revision\RevisionStoreRecord;
class ApiVisualEditor extends ApiBase {
use ApiParsoidTrait;
use ApiBlockInfoTrait;
use ApiParsoidTrait;
/**
* @inheritDoc