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

WindPress – Tailwind CSS integration for WordPress, version 3.2.89. 50 lines.

- Page: https://pluginprobe.com/plugins/windpress/3.2.89/code/src/Integration/Timber/Compile.php
- Raw: https://pluginprobe.com/plugins/windpress/3.2.89/raw/src/Integration/Timber/Compile.php
- Modified: 2026-09-16T09:39:08+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.2.89/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 WindPressDeps\Symfony\Component\Finder\Finder;
use Timber\LocationManager;
use Timber\Timber;
use WindPress\WindPress\Core\Scanner\FileScanner;
/**
 * @author Joshua Gugun Siagian <suabahasa@gmail.com>
 */
class Compile
{
    /**
     * @param array $metadata
     */
    public function __invoke($metadata): array
    {
        if (!class_exists(Timber::class)) {
            return [];
        }
        return $this->get_contents($metadata);
    }
    public function get_contents($metadata): array
    {
        return FileScanner::scan_files('timber', static function (): \Generator {
            $paths = LocationManager::get_locations();
            $paths = array_unique(array_filter(array_merge(...array_values($paths)), static fn($path) => is_string($path) && $path !== '/' && is_dir($path)));
            if ($paths === []) {
                return;
            }
            $finder = new Finder();
            $finder->in($paths)->files()->name('*.twig');
            do_action('a!windpress/integration/timber/compile:get_contents.finder', $finder);
            foreach ($finder as $file) {
                yield ['path' => $file->getPathname(), 'name' => $file->getRelativePathname()];
            }
        }, $metadata['next_batch'] ?? \false);
    }
}

```
