laulamanapps/phpunit-debug-code-detector

Detect debug code in your project files

dev-master 2021-05-21 15:39 UTC

This package is auto-updated.

Last update: 2024-10-21 23:43:17 UTC


README

Have you ever pushed code to a repository containing debug code? Me Too! With this PHPUnit extension you'll at least be notified when your test run.

Screenshot

Install

Require

$ composer require --dev laulamanapps/phpunit-debug-code-detector

Configure:

<extensions>
    <extension class="LauLamanApps\DebugCodeDetector\DebugCodeDetectorExtension">
        <arguments>
            <array><!-- Folders we want scanned -->
                <element key="0"><string>src</string></element>
                <element key="1"><string>templates</string></element>
            </array>
        </arguments>
    </extension>
</extensions>

Enable only some detectors:

<extensions>
    <extension class="LauLamanApps\DebugCodeDetector\DebugCodeDetectorExtension">
        <arguments>
            <array><!-- Folders we want scanned -->
                <element key="0"><string>src</string></element>
                <element key="1"><string>templates</string></element>
            </array>
            <array><!-- Detectors we want to use -->
                <element key="0"><object class="LauLamanApps\DebugCodeDetector\Detector\Php\VarDumpDetector"/></element>
                <element key="1"><object class="LauLamanApps\DebugCodeDetector\Detector\Php\PrintRDetector"/></element>
                <element key="2"><object class="LauLamanApps\DebugCodeDetector\Detector\Symfony\VarDumper\DumpDetector"/></element>
            </array>
        </arguments>
    </extension>
</extensions>

Disable colorful output:

<extensions>
    <extension class="LauLamanApps\DebugCodeDetector\DebugCodeDetectorExtension">
        <arguments>
            <array><!-- Folders we want scanned -->
                <element key="0"><string>src</string></element>
                <element key="1"><string>templates</string></element>
            </array>
            <string>all</string><!-- Use all detectors -->
            <bool>false</bool>
        </arguments>
    </extension>
</extensions>