Better PHP7 support, more diagnostics, less false positives
The PHP7 support is still incomplete, but we're getting closer to fix that.
NoVerify works well in self-contained codebases that have all dependencies under their source root. It also requires all types to be resolvable and reports most usages of
mixed-typed values as errors. We aware that it could be too strict for many users, perhaps there will be a flag that makes NoVerify more tolerant of untyped code in the future.
Feedback is appreciated.
How to get started
- Download a binary for your platform.
- Run NoVerify over your PHP project with
Try to avoid running NoVerify over a code that can include definition duplicates. It complicates running analysis over tests, but we're working on making this limitation go away.
More usage info: docs/linter-usage.md.
To list supported diagnostics run
noverify --help. Example output:
Diagnostics (checks): accessLevel Report erroneous member access. argCount Report mismatching args count inside call expressions. arrayAccess Report array access to non-array objects. (+ more lines)
regexpSimplifytells how to simplify patterns
regexpVetfinds suspicious pattern parts
regexpSyntaxreports syntax errors in patterns
newAbstractforbids using abstract classes in
nameCaserequires the same spelling of classes and functions at definitions and usages
unimplementedreports unimplemented interface/abstract methods
misspellfinds common misspellings in comments and some identifiers
discardExprreports "evaluated but not used" expressions
voidResultUsedreports usage of void-typed expressions
- For simple use cases there is no need to set
- Linter now understand traits better
instanceofinside ternary expression condition is now respected (#288)
- Linter now collects info from
- Nullable types
?Tare now supported
method_exists()permit calling tested symbol inside if body
- Several improvements to a types inference
UNUSEDseverity level is not used in non-LSP mode (#397)
- Case-insensitive symbols handling is improved
- Directory traversal speed is increased significantly (#333)
- Lexing became 5-10% faster due to
golex -> Ragelswitch (#381)
- PHP7 style nowdoc/heredoc are now parsed correctly (#327)
- Added Finding the false-positive document