From: Timo Tijhof Date: Thu, 23 Feb 2017 04:47:46 +0000 (-0800) Subject: phpunit: Fix AvroFormatterTest failure on PHP 7 X-Git-Tag: 1.31.0-rc.0~4003^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=f89eaf4312bb0d852ceb23afb544adf7cd48d96d;p=lhc%2Fweb%2Fwiklou.git phpunit: Fix AvroFormatterTest failure on PHP 7 Fix the following error on PHP 7. > MediaWiki\Logger\Monolog\AvroFormatterTest::testDoesSomethingWhenSchemaAvailable > Only variables should be passed by reference > includes/debug/logger/monolog/AvroFormatter.php:143 Per https://github.com/researchgate/avro-php/blob/1.8.0/lib/avro/schema.php#L311-L314 the default for &$schemata is null, which is filled with a plain AvroNamedSchemata instance. So this parameter is obsolete. Either it needs to be assigned here and then passed. But since we don't use it anywhere and don't pass it any constructor arguments, the default should suffice. Bug: T75176 Bug: T141588 Change-Id: I144bed8a78eb267a97e41f379b89c5faaae30625 --- diff --git a/includes/debug/logger/monolog/AvroFormatter.php b/includes/debug/logger/monolog/AvroFormatter.php index ce0cda12d5..2700daa66f 100644 --- a/includes/debug/logger/monolog/AvroFormatter.php +++ b/includes/debug/logger/monolog/AvroFormatter.php @@ -138,9 +138,7 @@ class AvroFormatter implements FormatterInterface { $this->schemas[$channel]['schema'] = AvroSchema::parse( $schema ); } else { $this->schemas[$channel]['schema'] = AvroSchema::real_parse( - $schema, - null, - new AvroNamedSchemata() + $schema ); } }