src/Knp/Snappy/Pdf.php
protected function handleOptions(array $options = [])
    {
        foreach ($options as $option => $value) {
            if (null === $value) {
                unset($options[$option]);
                continue;
            }

            if (!empty($value) && array_key_exists($option, $this->optionsWithContentCheck)) {
                $saveToTempFile = !$this->isFile($value) && !$this->isOptionUrl($value);
                $fetchUrlContent = $option === 'xsl-style-sheet' && $this->isOptionUrl($value);

                if ($saveToTempFile || $fetchUrlContent) {
                    $fileContent = $fetchUrlContent ? file_get_contents($value) : $value;
                    $options[$option] = $this->createTemporaryFile($fileContent, $this->optionsWithContentCheck[$option]);
                }
            }
        }

        return $options;
    }
protected function handleOptions(array $options = [])
    {
        foreach ($options as $option => $value) {
            if (null === $value) {
                unset($options[$option]);
                continue;
            }

            if (!empty($value) && array_key_exists($option, $this->optionsWithContentCheck)) {
                $saveToTempFile = !$this->isFile($value) && !$this->isOptionUrl($value);
                $fetchUrlContent = $option === 'xsl-style-sheet' && $this->isOptionUrl($value);

                if ($saveToTempFile || $fetchUrlContent) {
                    $fileContent = $fetchUrlContent ? file_get_contents($value) : $value;
                    $options[$option] = $this->createTemporaryFile($fileContent, $this->optionsWithContentCheck[$option]);
                }
            }
        }

        return $options;
    }
protected function handleOptions ( array $ options = [ ] ) { foreach ( $ options as $ option => $ value ) { if ( null === $ value ) { unset ( $ options [ $ option ] ) ; continue ; } if ( ! empty ( $ value ) && array_key_exists ( $ option , $ this -> optionsWithContentCheck ) ) { $ saveToTempFile = ! $ this -> isFile ( $ value ) && ! $ this -> isOptionUrl ( $ value ) ; $ fetchUrlContent = $ option === 'xsl-style-sheet' && $ this -> isOptionUrl ( $ value ) ; if ( $ saveToTempFile || $ fetchUrlContent ) { $ fileContent = $ fetchUrlContent ? file_get_contents ( $ value ) : $ value ; $ options [ $ option ] = $ this -> createTemporaryFile ( $ fileContent , $ this -> optionsWithContentCheck [ $ option ] ) ; } } } return $ options ; }
Handle options to transform HTML strings into temporary files containing HTML.

@param array $options

@return array $options Transformed options
Handle options to transform HTML strings into temporary files containing HTML .