# windpress/3.0.6/src/Integration/Timber/Compile.php

WindPress – Tailwind CSS integration for WordPress, version 3.0.6. 51 lines.

- Page: https://pluginprobe.com/plugins/windpress/3.0.6/code/src/Integration/Timber/Compile.php
- Raw: https://pluginprobe.com/plugins/windpress/3.0.6/raw/src/Integration/Timber/Compile.php
- Modified: 2024-08-28T04:00:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/windpress/3.0.6/code/src/Integration/Timber/Compile.php#L10-L20`.

```php
<?php

/*
 * This file is part of the WindPress package.
 *
 * (c) Joshua Gugun Siagian <suabahasa@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
declare (strict_types=1);
namespace WindPress\WindPress\Integration\Timber;

use WindPressPackages\Symfony\Component\Finder\Finder;
use Timber\LocationManager;
use Timber\Timber;
/**
 * @author Joshua Gugun Siagian <suabahasa@gmail.com>
 */
class Compile
{
    public function __invoke() : array
    {
        if (!\class_exists(Timber::class)) {
            return [];
        }
        return $this->get_contents();
    }
    public function get_contents() : array
    {
        $contents = [];
        $paths = LocationManager::get_locations();
        $finder = new Finder();
        $finder->in($paths);
        $finder->files()->name('*.twig');
        \do_action('f!windpress/integration/timber/compile:get_contents.finder', $finder);
        foreach ($finder as $file) {
            $template_file = $file->getPathname();
            if (!\is_readable($template_file)) {
                continue;
            }
            $contents[] = [
                'name' => $file->getRelativePathname(),
                // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local file
                'content' => \file_get_contents($template_file),
            ];
        }
        return $contents;
    }
}

```
