protected function setHandlerByExtension($extension)
    {
        if (!in_array($extension, $this->file->supportedExtensions())) {
            throw new RuntimeException($this->translation->text('Unsupported file extension'));
        }

        return $this->handler = $this->file->getHandler(".$extension");
    }
protected function setHandlerByExtension($extension)
    {
        if (!in_array($extension, $this->file->supportedExtensions())) {
            throw new RuntimeException($this->translation->text('Unsupported file extension'));
        }

        return $this->handler = $this->file->getHandler(".$extension");
    }
protected function setHandlerByExtension ( $ extension ) { if ( ! in_array ( $ extension , $ this -> file -> supportedExtensions ( ) ) ) { throw new RuntimeException ( $ this -> translation -> text ( 'Unsupported file extension' ) ) ; } return $ this -> handler = $ this -> file -> getHandler ( ".$extension" ) ; }
Find and set handler by a file extension
@param string $extension
@return array
@throws RuntimeException
Find and set handler by a file extension