2017 © Pedro Peláez
 

library php-var-dump-check

Find forgotten variables dump in PHP source code.

image

systemhaus/php-var-dump-check

Find forgotten variables dump in PHP source code.

  • Wednesday, February 8, 2017
  • by seaneble
  • Repository
  • 2 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP VarDump Check

This is a fork of JakubOnderka/PHP-Var-Dump-Check, (*1)

PHP console application for find forgotten variable dump. Support PHP build in method print_r, var_dump and var_export method and also method from Tracy debugger, Ladybug, Symfony, Laravel, Doctrine and Zend Framework., (*2)

Install

Just create a composer.json file and run the php composer.phar install command to install it:, (*3)

{
    "require-dev": {
        "systemhaus/php-var-dump-check": "~0.2"
    }
}

For colored output install suggested package jakub-onderka/php-console-highlighter., (*4)

Usage and example output

$ ./vendor/bin/var-dump-check --no-colors --tracy .
...................X...

Checked 23 files in 0.1 second, dump found in 1 file

------------------------------------------------------------
Forgotten dump 'var_dump' found in ./test.php:36
    34|         $functionsToCheck = $this->prepareFunctionCheck($this->settings->functionsToCheck);
    35|
  > 36|         var_dump($functionsToCheck);
    37|
    38|         foreach ($tokens as $key => $token) {

Options for run

  • none - check dump: var_dump, var_export, print_r
  • --ladybug - check dump: ladybug_dump, ladybug_dump_die, ld, ldd
  • --tracy - check dump: dump, Debugger::dump
  • --zend - check dump: Zend_Debug::dump, \Zend\Debug\Debug::dump
  • --doctrine - check dump: Doctrine::dump, \Doctrine\Common\Util\Debug::dump
  • --symfony - check dump: dump, VarDumper::dump, VarDumper::setHandler
  • --laravel - check dump: dd
  • --no-colors - disable colors from output
  • --exclude folder/ - exclude folder/ from check
  • --extensions php,phpt,php7 - map file extensions for check

For run from command line:, (*5)

$ ./vendor/bin/var-dump-check --symfony --exclude app --exclude vendor .

or setting for ANT:, (*6)

<condition property="var-dump-check" value="${basedir}/bin/var-dump-check.bat" else="${basedir}/bin/var-dump-check">
    <os family="windows"/>
</condition>

<target name="var-dump-check" description="Run PHP VarDump check">
    <exec executable="${var-dump-check}" failonerror="true">
        <arg line='--exclude ${basedir}/app/' />
        <arg line='--exclude ${basedir}/vendor/' />
        <arg line='${basedir}' />
    </exec>
</target>

The Versions

08/02 2017

dev-master

9999999-dev

Find forgotten variables dump in PHP source code.

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.3

 

The Development Requires

by Jasper Eumann

13/03 2015

v0.2

0.2.0.0

Find forgotten variables dump in PHP source code.

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.3

 

The Development Requires

24/11 2013

0.1

0.1.0.0

Find forgotten variables dump in PHP source code.

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.2

 

The Development Requires