Skip to content

Commit

Permalink
Remove dd if present (#2)
Browse files Browse the repository at this point in the history
* Remove dd if present

* Fix autoloader
  • Loading branch information
akovalyov committed Apr 19, 2018
1 parent 7c15798 commit 2ef425d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ it was considered too risky to have it in core (see discussion at https://github

*N.B.* These fixers are risky and potentially can break your application. You should understand consequences of having it in your project (especially a legacy one). You are warned.

## Functions being removed:

* dump
* var_dump
* [dd](https://github.com/symfony/symfony/pull/26970)

## Usage

Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"Drew\\DebugStatementsFixers\\" : "src/"
}
},
"autoload-dev": {
"psr-4": {
"PhpCsFixer\\Tests\\": "vendor/friendsofphp/php-cs-fixer/tests/"
}
},
"require": {
"friendsofphp/php-cs-fixer": "^2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class Dump extends AbstractFunctionReferenceFixer
/**
* @var array
*/
private $functions = array('dump', 'var_dump');
private $functions = array('dump', 'var_dump', 'dd');

/**
* {@inheritdoc}
Expand Down
8 changes: 8 additions & 0 deletions tests/DumpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ class dump{ function dump(){} }
new dump();
',
),
array(
'<?php
echo "The world has changed";
',
'<?php
echo "The world has changed";dd($_SERVER);
',
),
);
}
}

0 comments on commit 2ef425d

Please sign in to comment.