public function isZip(UploadedFile $file, $workspace)
    {
        $isZip = false;
        if ('application/zip' === $file->getClientMimeType() || true === $this->getZip()->open($file)) {
            // Correct Zip type => check if html root file exists
            $rootFile = $this->guessRootFile($file, $workspace);

            if (!empty($rootFile)) {
                $isZip = true;
            }
        }

        return $isZip;
    }
public function isZip(UploadedFile $file, $workspace)
    {
        $isZip = false;
        if ('application/zip' === $file->getClientMimeType() || true === $this->getZip()->open($file)) {
            // Correct Zip type => check if html root file exists
            $rootFile = $this->guessRootFile($file, $workspace);

            if (!empty($rootFile)) {
                $isZip = true;
            }
        }

        return $isZip;
    }
public function isZip ( UploadedFile $ file , $ workspace ) { $ isZip = false ; if ( 'application/zip' === $ file -> getClientMimeType ( ) || true === $ this -> getZip ( ) -> open ( $ file ) ) { // Correct Zip type => check if html root file exists $ rootFile = $ this -> guessRootFile ( $ file , $ workspace ) ; if ( ! empty ( $ rootFile ) ) { $ isZip = true ; } } return $ isZip ; }
Checks if a UploadedFile is a zip and contains index.html file.

@param \Symfony\Component\HttpFoundation\File\UploadedFile $file

@return bool
Checks if a UploadedFile is a zip and contains index . html file .