Skip to content

Commit 2ef425d

Browse files
authored
Remove dd if present (#2)
* Remove dd if present * Fix autoloader
1 parent 7c15798 commit 2ef425d

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ it was considered too risky to have it in core (see discussion at https://github
1717

1818
*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.
1919

20+
## Functions being removed:
21+
22+
* dump
23+
* var_dump
24+
* [dd](https://github.com/symfony/symfony/pull/26970)
2025

2126
## Usage
2227

composer.json

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"Drew\\DebugStatementsFixers\\" : "src/"
1515
}
1616
},
17+
"autoload-dev": {
18+
"psr-4": {
19+
"PhpCsFixer\\Tests\\": "vendor/friendsofphp/php-cs-fixer/tests/"
20+
}
21+
},
1722
"require": {
1823
"friendsofphp/php-cs-fixer": "^2.0"
1924
},

src/Dump.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class Dump extends AbstractFunctionReferenceFixer
1515
/**
1616
* @var array
1717
*/
18-
private $functions = array('dump', 'var_dump');
18+
private $functions = array('dump', 'var_dump', 'dd');
1919

2020
/**
2121
* {@inheritdoc}

tests/DumpTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ class dump{ function dump(){} }
9090
new dump();
9191
',
9292
),
93+
array(
94+
'<?php
95+
echo "The world has changed";
96+
',
97+
'<?php
98+
echo "The world has changed";dd($_SERVER);
99+
',
100+
),
93101
);
94102
}
95103
}

0 commit comments

Comments
 (0)