PHP 8.2.31
Preview: TemplateLoader.php Size: 1.02 KB
/opt/cpanel/ea-wappspector/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/TemplateLoader.php

<?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Framework\MockObject\Generator;

use SebastianBergmann\Template\Template;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This trait is not covered by the backward compatibility promise for PHPUnit
 */
trait TemplateLoader
{
    /**
     * @psalm-var array<string,Template>
     */
    private static array $templates = [];

    /**
     * @psalm-suppress MissingThrowsDocblock
     */
    private function loadTemplate(string $template): Template
    {
        $filename = __DIR__ . '/templates/' . $template;

        if (!isset(self::$templates[$filename])) {
            self::$templates[$filename] = new Template($filename);
        }

        return self::$templates[$filename];
    }
}

Directory Contents

Dirs: 2 × Files: 7

Name Size Perms Modified Actions
Exception DIR
- drwxr-xr-x 2026-01-27 05:48:37
Edit Download
templates DIR
- drwxr-xr-x 2026-01-27 05:48:37
Edit Download
34.30 KB lrw-r--r-- 2026-01-27 05:48:37
Edit Download
1.79 KB lrw-r--r-- 2026-01-27 05:48:37
Edit Download
11.76 KB lrw-r--r-- 2026-01-27 05:48:37
Edit Download
1.18 KB lrw-r--r-- 2026-01-27 05:48:37
Edit Download
1.21 KB lrw-r--r-- 2026-01-27 05:48:37
Edit Download
626 B lrw-r--r-- 2026-01-27 05:48:37
Edit Download
1.02 KB lrw-r--r-- 2026-01-27 05:48:37
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).