biurad/flange

View on GitHub
src/Debug/Tracy/templates/ContainerPanel.panel.phtml

Summary

Maintainability
Test Coverage
<?php declare(strict_types=1);

/*
 * This file is part of Biurad opensource projects.
 *
 * @copyright 2019 Biurad Group (https://biurad.com/)
 * @license   https://opensource.org/licenses/BSD-3-Clause License
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Flange\Debug\Tracy;

use Tracy\Dumper;
use Tracy\Helpers;

?>
<style class="tracy-debug">
    #tracy-debug .nette-ContainerPanel table {
        width: 100%;
        white-space: nowrap;
    }

    #tracy-debug .nette-ContainerPanel .created {
        font-weight: bold;
    }

    #tracy-debug .nette-ContainerPanel .yes {
        color: green;
        font-weight: bold;
    }

    #tracy-debug .nette-ContainerPanel table pre {
        display: inline;
        background: transparent;
    }
</style>

<h1><?php echo \get_class($this->container); ?></h1>

<div class="tracy-inner nette-ContainerPanel">
    <div class="tracy-inner-container">
        <h2>Services</h2>

        <table class="tracy-sortable">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Autowired</th>
                    <th>Initialized</th>
                    <th>Service</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($instances as $id => $service) { ?>
                <tr>
                    <td
                        class="<?php echo isset($services[$id]) ? 'created' : ''; ?>">
                        <?php echo \is_numeric($id) ? "<span title='$id'>–</span>" : Helpers::escapeHtml($id); ?>
                    </td>
                    <td
                        class="<?php echo isset($types[$id]) ? 'yes' : ''; ?>">
                        <?php echo isset($types[$id]) ? 'yes' : 'no'; ?>
                    </td>
                    <td
                        class="<?php echo $this->container->shared($id) ? 'yes' : ''; ?>">
                        <?php echo $this->container->shared($id) ? 'yes' : 'no'; ?>
                    </td>
                    <td>
                        <?php if (isset($services[$id])) { ?>
                        <?php echo Dumper::toHtml($services[$id] ?? $service, [Dumper::COLLAPSE => true, Dumper::LIVE => true]); ?>
                        <?php } else { ?>
                        <code><?php echo Dumper::toHtml($service); ?></code>
                        <?php } ?>
                    </td>
                </tr>
                <?php } ?>
            </tbody>
        </table>

        <h2>Configurations</h2>

        <div class="nette-ContainerPanel-parameters">
            <?php echo Dumper::toHtml($configs); ?>
        </div>

        <p>Source: <?php echo Helpers::editorLink($file); ?></p>
    </div>
</div>