Skip to content
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

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open

Add --custom-function parameter to check. #32

wants to merge 51 commits into from

Conversation

umutphp
Copy link

@umutphp umutphp commented Dec 11, 2018

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.

@umutphp
Copy link
Author

umutphp commented Dec 19, 2018

This will fix the issue #33.

.gitignore Outdated
/composer.lock
.idea
Copy link
Owner

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.

Copy link
Author

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"
Copy link
Owner

@JakubOnderka JakubOnderka Jan 5, 2019

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

Copy link
Author

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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use empty()

Copy link
Author

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

@JakubOnderka
Copy link
Owner

JakubOnderka commented Jan 5, 2019

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.

@kl3sk
Copy link

kl3sk commented Oct 23, 2019

Is this mergable ?

@umutphp
Copy link
Author

umutphp commented Oct 24, 2019

Is this mergable ?

@kl3sk Technically yes, but I think the owner of the repo is a bit busy for a while.

@kl3sk
Copy link

kl3sk commented Oct 25, 2019

Ok, I didn't know it. Wait for it.

jrfnl and others added 27 commits August 14, 2020 11:45
Using the caret is the recommended manner of setting a version requirement.
Using the caret is the recommended manner of setting a version requirement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants