浏览代码

Make IOInterface implement psr-4 LoggerInterface, fixes #5180

Jordi Boggiano 6 年之前
父节点
当前提交
6c782599f1

+ 1 - 2
src/Composer/IO/BaseIO.php

@@ -14,10 +14,9 @@ namespace Composer\IO;
 
 use Composer\Config;
 use Composer\Util\ProcessExecutor;
-use Psr\Log\LoggerInterface;
 use Psr\Log\LogLevel;
 
-abstract class BaseIO implements IOInterface, LoggerInterface
+abstract class BaseIO implements IOInterface
 {
     protected $authentications = array();
 

+ 2 - 1
src/Composer/IO/IOInterface.php

@@ -13,13 +13,14 @@
 namespace Composer\IO;
 
 use Composer\Config;
+use Psr\Log\LoggerInterface;
 
 /**
  * The Input/Output helper interface.
  *
  * @author François Pluchino <francois.pluchino@opendisplay.com>
  */
-interface IOInterface
+interface IOInterface extends LoggerInterface
 {
     const QUIET = 1;
     const NORMAL = 2;

+ 0 - 1
src/Composer/Util/Http/CurlDownloader.php

@@ -20,7 +20,6 @@ use Composer\Util\RemoteFilesystem;
 use Composer\Util\StreamContextFactory;
 use Composer\Util\AuthHelper;
 use Composer\Util\Url;
-use Psr\Log\LoggerInterface;
 use React\Promise\Promise;
 
 /**

+ 1 - 3
src/Composer/Util/HttpDownloader.php

@@ -17,7 +17,6 @@ use Composer\IO\IOInterface;
 use Composer\Downloader\TransportException;
 use Composer\CaBundle\CaBundle;
 use Composer\Util\Http\Response;
-use Psr\Log\LoggerInterface;
 use React\Promise\Promise;
 
 /**
@@ -58,8 +57,7 @@ class HttpDownloader
         // Setup TLS options
         // The cafile option can be set via config.json
         if ($disableTls === false) {
-            $logger = $io instanceof LoggerInterface ? $io : null;
-            $this->options = StreamContextFactory::getTlsDefaults($options, $logger);
+            $this->options = StreamContextFactory::getTlsDefaults($options, $io);
         } else {
             $this->disableTls = true;
         }

+ 1 - 3
src/Composer/Util/RemoteFilesystem.php

@@ -16,7 +16,6 @@ use Composer\Config;
 use Composer\IO\IOInterface;
 use Composer\Downloader\TransportException;
 use Composer\CaBundle\CaBundle;
-use Psr\Log\LoggerInterface;
 
 /**
  * @author François Pluchino <francois.pluchino@opendisplay.com>
@@ -61,8 +60,7 @@ class RemoteFilesystem
         // Setup TLS options
         // The cafile option can be set via config.json
         if ($disableTls === false) {
-            $logger = $io instanceof LoggerInterface ? $io : null;
-            $this->options = StreamContextFactory::getTlsDefaults($options, $logger);
+            $this->options = StreamContextFactory::getTlsDefaults($options, $io);
         } else {
             $this->disableTls = true;
         }