jakubonderka / php-var-dump-check Goto Github PK
View Code? Open in Web Editor NEWFind forgotten variables dump in PHP source code.
License: Other
Find forgotten variables dump in PHP source code.
License: Other
Hi,
in https://travis-ci.org/JakubOnderka/PHP-Var-Dump-Check isn't start build. Please, check it.
Hi,
why are tests execute with version 5.3.3? In composer.json is required PHP 5.3.2.
For test
...
public function __construct()
{
$settings = new PhpVarDumpCheck\Settings();
$settings->functionsToCheck = array_merge($settings->functionsToCheck, array(
PhpVarDumpCheck\Settings::DEBUGGER_DUMP,
PhpVarDumpCheck\Settings::DEBUGGER_DUMP_SHORTCUT,
));
$this->uut = new PhpVarDumpCheck\Checker($settings);
}
public function testCheck_tracyDebugDump()
{
$content = <<<PHP
<?php
Debugger::dump(\$var);
OtherClass::dump(\$var);
PHP;
$result = $this->uut->check($content);
$this->assertCount(1, $result);
}
...
is failure output (from PHPUnit)
There were 1 failures:
1) TracyTest::testCheck_tracyDebugDump
Failed asserting that actual size 2 matches expected size 1.
It would be nice to have a PHAR file available without having to add php-var-dump-check as requirement to projects.
Idea: check forgotten dumps from Latte templates. Example of use is in documentation http://doc.nette.org/en/2.2/default-macros#toc-variable-dumping.
How it implement? That will not do with PHP tokens. Use regular expressions?
In one of the projects that I have been working for a while, there are some legacy dump functions created and used frequently by the team. A sample function is;
function pre_dump( $var ) { echo '<pre>'; var_dump( $var ); echo '</pre>'; }
The check can not be able to find the usage of such kind of functions. A sample usage might be;
$ ./vendor/bin/var-dump-check --no-colors --tracy --custom-function pre_dump,echo_dump .
I have created a pull request for this case.
Doctrine has its own dump method, which strips a lot of internal information and recursions.
\Doctrine\Common\Util\Debug::dump($var);
Is there a chance this could be included into this nice tool?
Hi,
Very nice tool, good job man. :)
Laravel also has a dump
helper, but it's currently not being detected with the Laravel preset.
https://laravel.com/docs/5.7/helpers#method-dump
Also, the Laravel preset doesn't seem to pick up on dd()
in Blade files. When used as {{ dd($foo) }}
Is this something you would be interested in adding to the current preset?
In Symfony 2.6 added VarDumper.
http://symfony.com/blog/new-in-symfony-2-6-vardumper-component
Dump function can be in Twig or source code. If you forget to remove featuring production environment, it would be a exception.
Thanks.
Last version of the package is v0.2 which is released on Mar 13, 2015. The README states that there are options such as --symfony, --laravel, --doctrine but in the latest release these options are not available. Do you plan to release a new version with the latest changes in the master branch?
Hi,
Could you please create a new release version? I've check new Symfony shortcuts too. Thanks!
it would be nice to also check twig templates using dump() method
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.