Skip to content

ruscoe/php-hound

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Hound

php-hound-banner

An opinionated PHP issue sniffer written in Rust.

Usage

Run with the path to your PHP files:

cargo run -- -p examples

You can optionally ignore paths:

cargo run -- --path examples --ignore examples/vendor --ignore examples/tests

Scans for

Possible accidental assignment

Checks if and elseif for accidential assignment ($a = $b rather than $a == $b)

While it is not technically wrong to use something like if ($a = function()) {} to determine if a function returns false or NULL, this is side-effect programming and can lead to a confusing codebase.

Incrementing and decrementing variables inside conditions

Checks if and elseif for incrementing or decrementing variables.

A case of side-effect programming, changing variables inside conditions can be confusing.

Use of the eval() function

Using eval() is a security risk, allowing possible remote code execution.

Use of the var_dump() function

This usually means some debug code has been left in the codebase.

About

An opinionated PHP issue sniffer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages