vendor/maximebf/debugbar/src/DebugBar/Bridge/NamespacedTwigProfileCollector.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

declare(strict_types=1);

namespace DebugBar\Bridge;

use DebugBar\DataCollector\AssetProvider;
use DebugBar\DataCollector\DataCollector;
use DebugBar\DataCollector\Renderable;
use Twig\Environment;
use Twig\Loader\LoaderInterface;
use Twig\Profiler\Dumper\HtmlDumper;
use Twig\Profiler\Profile;

/**
 * Collects data about rendered templates
 *
 * http://twig.sensiolabs.org/
 *
 * A \Twig\Profiler\Profile should be added to your \Twig\Environment
 * The root-Twig\Profiler\Profile-object should then be injected into this collector
 *
 * you can optionally provide the \Twig\Environment or the \Twig\Loader to also create
 * debug-links.
 *
 * @see \Twig\Extension\ProfilerExtension, \Twig\Profiler\Profile
 *
 * <code>
 * $env = new \Twig\Environment($loader); // Or from a PSR11-container
 * $profile = new \Twig\Profiler\Profile();
 * $env->addExtension(new \Twig\Extension\ProfilerExtension($profile));
 * $debugbar->addCollector(new ModernTwigProfileCollector($profile, $env));
 * // or: $debugbar->addCollector(new ModernTwigProfileCollector($profile, $loader));
 * </code>
 */
class NamespacedTwigProfileCollector extends DataCollector implements Renderable, AssetProvider
{
    /**
     * @var Profile
     */
    private $profile;

    /**
     * @var LoaderInterface|Environment|null
     */
    private $loader;

    /**
     * @var int
     */
    private $templateCount;

    /**
     * @var int
     */
    private $blockCount;

    /**
     * @var int
     */
后面还有 144 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。