-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --custom-function parameter to check. #32
base: master
Are you sure you want to change the base?
Conversation
This will fix the issue #33. |
.gitignore
Outdated
/composer.lock | ||
.idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please revert that change? .idea
folder is IDE specific and you should ignore it thought global gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the change.
README.md
Outdated
@@ -48,6 +48,7 @@ Options for run | |||
- `--doctrine` - check dump: `Doctrine::dump`, `\Doctrine\Common\Util\Debug::dump` | |||
- `--symfony` - check dump: `dump`, `VarDumper::dump`, `VarDumper::setHandler` | |||
- `--laravel` - check dump: `dd`, `dump` | |||
- `--custom-function` - comma separated custom function name(s) to check like "pre_echo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ` instead of "
to match other parameters description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" is replaced with ` .
src/Settings.php
Outdated
@@ -131,6 +136,13 @@ public static function parseArguments(array $arguments) | |||
} | |||
} | |||
$setting->functionsToCheck = array_unique($setting->functionsToCheck); | |||
|
|||
// Any custom function is given | |||
if (count($customFunctions) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use empty()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty is used instead of count($customFunctions) > 0
Thanks for your pull request, I am happy to add that functionality after you resolve conflict and requested changes. Thanks! When this will be merged, I will release a new version. |
Is this mergable ? |
@kl3sk Technically yes, but I think the owner of the repo is a bit busy for a while. |
Ok, I didn't know it. Wait for it. |
Using the caret is the recommended manner of setting a version requirement.
Array access using curly braces has been deprecated in PHP 7.4. Ref: https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.array-string-access-curly-brace
Caused by the review message in the following link. php-parallel-lint/PHP-Var-Dump-Check#6 (comment)
Using the caret is the recommended manner of setting a version requirement.
Array access using curly braces has been deprecated in PHP 7.4. Ref: https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.array-string-access-curly-brace
Caused by the review message in the following link. php-parallel-lint/PHP-Var-Dump-Check#6 (comment)
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 this kind of functions. With this pull request, user can give the names of such kind of custom debug functions to the check function with "--custom-function" parameter.