X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Ffilebackend%2FFileBackend.php;h=4ad48c70c1de0d6620dacf602ef0ab00656911d2;hp=19373eaef94d528054989ce8881cb107b3ae1106;hb=6cfb2e3d7a2b96d5041312fcec88248bb46573d7;hpb=260b4541f4a3cd671edc27818957263f3cdf05a4 diff --git a/includes/libs/filebackend/FileBackend.php b/includes/libs/filebackend/FileBackend.php index 19373eaef9..4ad48c70c1 100644 --- a/includes/libs/filebackend/FileBackend.php +++ b/includes/libs/filebackend/FileBackend.php @@ -30,6 +30,7 @@ use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Wikimedia\ScopedCallback; +use Psr\Log\NullLogger; /** * @brief Base class for all file backend classes (including multi-write backends). @@ -162,9 +163,8 @@ abstract class FileBackend implements LoggerAwareInterface { */ public function __construct( array $config ) { $this->name = $config['name']; - $this->domainId = isset( $config['domainId'] ) - ? $config['domainId'] // e.g. "my_wiki-en_" - : $config['wikiId']; // b/c alias + $this->domainId = $config['domainId'] // e.g. "my_wiki-en_" + ?? $config['wikiId']; // b/c alias if ( !preg_match( '!^[a-zA-Z0-9-_]{1,255}$!', $this->name ) ) { throw new InvalidArgumentException( "Backend name '{$this->name}' is invalid." ); } elseif ( !is_string( $this->domainId ) ) { @@ -191,7 +191,7 @@ abstract class FileBackend implements LoggerAwareInterface { if ( !is_callable( $this->profiler ) ) { $this->profiler = null; } - $this->logger = $config['logger'] ?? new \Psr\Log\NullLogger(); + $this->logger = $config['logger'] ?? new NullLogger(); $this->statusWrapper = $config['statusWrapper'] ?? null; $this->tmpDirectory = $config['tmpDirectory'] ?? null; } @@ -1576,11 +1576,10 @@ abstract class FileBackend implements LoggerAwareInterface { * - StatusValue::newGood() if this method is called without parameters * - StatusValue::newFatal() with all parameters to this method if passed in * - * @param string $args,... + * @param string ...$args * @return StatusValue */ - final protected function newStatus() { - $args = func_get_args(); + final protected function newStatus( ...$args ) { if ( count( $args ) ) { $sv = StatusValue::newFatal( ...$args ); } else {