public function registerConverter(OutputConverterInterface $converter) {
        foreach ($converter->getSupportedMimeTypes() as $mimeType => $extensions) {
            if (!is_array($extensions)) {
                $extensions = [$extensions];
            }

            if (!isset($this->convertersByMimeType[$mimeType])) {
                $this->convertersByMimeType[$mimeType] = [];
            }

            if (!isset($this->mimeTypeToExtension[$mimeType])) {
                $this->mimeTypeToExtension[$mimeType] = $extensions[0];
            }

            $this->convertersByMimeType[$mimeType][] = $converter;

            foreach ($extensions as $extension) {
                if (!isset($this->convertersByExtension[$extension])) {
                    $this->convertersByExtension[$extension] = [];
                }

                if (!isset($this->extensionToMimeType[$extension])) {
                    $this->extensionToMimeType[$extension] = $mimeType;
                }

                $this->convertersByExtension[$extension][] = $converter;
            }
        }

        return $this;
    }
public function registerConverter(OutputConverterInterface $converter) {
        foreach ($converter->getSupportedMimeTypes() as $mimeType => $extensions) {
            if (!is_array($extensions)) {
                $extensions = [$extensions];
            }

            if (!isset($this->convertersByMimeType[$mimeType])) {
                $this->convertersByMimeType[$mimeType] = [];
            }

            if (!isset($this->mimeTypeToExtension[$mimeType])) {
                $this->mimeTypeToExtension[$mimeType] = $extensions[0];
            }

            $this->convertersByMimeType[$mimeType][] = $converter;

            foreach ($extensions as $extension) {
                if (!isset($this->convertersByExtension[$extension])) {
                    $this->convertersByExtension[$extension] = [];
                }

                if (!isset($this->extensionToMimeType[$extension])) {
                    $this->extensionToMimeType[$extension] = $mimeType;
                }

                $this->convertersByExtension[$extension][] = $converter;
            }
        }

        return $this;
    }
public function registerConverter ( OutputConverterInterface $ converter ) { foreach ( $ converter -> getSupportedMimeTypes ( ) as $ mimeType => $ extensions ) { if ( ! is_array ( $ extensions ) ) { $ extensions = [ $ extensions ] ; } if ( ! isset ( $ this -> convertersByMimeType [ $ mimeType ] ) ) { $ this -> convertersByMimeType [ $ mimeType ] = [ ] ; } if ( ! isset ( $ this -> mimeTypeToExtension [ $ mimeType ] ) ) { $ this -> mimeTypeToExtension [ $ mimeType ] = $ extensions [ 0 ] ; } $ this -> convertersByMimeType [ $ mimeType ] [ ] = $ converter ; foreach ( $ extensions as $ extension ) { if ( ! isset ( $ this -> convertersByExtension [ $ extension ] ) ) { $ this -> convertersByExtension [ $ extension ] = [ ] ; } if ( ! isset ( $ this -> extensionToMimeType [ $ extension ] ) ) { $ this -> extensionToMimeType [ $ extension ] = $ mimeType ; } $ this -> convertersByExtension [ $ extension ] [ ] = $ converter ; } } return $ this ; }
Register a single output converter with the manager to make it available inside Imbo.

@param OutputConverterInterface $converter The converter to register
@return self
Register a single output converter with the manager to make it available inside Imbo .