/**
  * @param string[]|\Jose\Compression\CompressionInterface[] $methods
  *
  * @return \Jose\Compression\CompressionManagerInterface
  */
 public static function createCompressionManager(array $methods)
 {
     $compression_manager = new CompressionManager();
     foreach ($methods as $method) {
         if ($method instanceof CompressionInterface) {
             $compression_manager->addCompressionAlgorithm($method);
         } else {
             Assertion::string($method, 'Bad argument: must be a list with either method names (string) or instances of CompressionInterface.');
             $class = self::getMethodClass($method);
             $compression_manager->addCompressionAlgorithm(new $class());
         }
     }
     return $compression_manager;
 }
 /**
  * @param array $methods
  *
  * @return \Jose\Compression\CompressionManagerInterface
  */
 public static function createCompressionManager(array $methods)
 {
     $compression_manager = new CompressionManager();
     foreach ($methods as $key => $value) {
         if ($value instanceof CompressionInterface) {
             $compression_manager->addCompressionAlgorithm($value);
         } elseif (is_string($value)) {
             $class = self::getMethodClass($value);
             $compression_manager->addCompressionAlgorithm(new $class());
         } else {
             $class = self::getMethodClass($key);
             $compression_manager->addCompressionAlgorithm(new $class($value));
         }
     }
     return $compression_manager;
 }