src/Phug/Phug.php
public static function cacheDirectory($source, $destination = null, $options = null)
    {
        if ($destination && !is_array($destination)) {
            $destination = [
                'cache_dir' => $destination,
            ];
        }

        return static::getRenderer(array_merge(
            $options ?: [], // @codeCoverageIgnore
            $destination ?: [] // @codeCoverageIgnore
        ))->cacheDirectory($source);
    }
public static function cacheDirectory($source, $destination = null, $options = null)
    {
        if ($destination && !is_array($destination)) {
            $destination = [
                'cache_dir' => $destination,
            ];
        }

        return static::getRenderer(array_merge(
            $options ?: [], // @codeCoverageIgnore
            $destination ?: [] // @codeCoverageIgnore
        ))->cacheDirectory($source);
    }
Cache a whole directory and return an array with [$successCount, $errorCount, $errorDetails].

@param string      $source      input directories containing pug files
@param string|null $destination output for compiled PHP files
(if array given, will be used as options array)
@param array|null  $options     optional options

@throws RendererException

@return array