Better PHP7 support, more diagnostics, less false positives
Pre-releaseThe 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
noverify ./src/
.
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)
Recent changes
New checkers:
regexpSimplify
tells how to simplify patternsregexpVet
finds suspicious pattern partsregexpSyntax
reports syntax errors in patternsnewAbstract
forbids using abstract classes innew
expressionsnameCase
requires the same spelling of classes and functions at definitions and usagesunimplemented
reports unimplemented interface/abstract methodsmisspell
finds common misspellings in comments and some identifiersdiscardExpr
reports "evaluated but not used" expressionsvoidResultUsed
reports usage of void-typed expressions
Improvements:
- For simple use cases there is no need to set
-cache
now - Linter now understand traits better
isset
/instanceof
inside ternary expression condition is now respected (#288)- Linter now collects info from
@method
and@property
annotations - Nullable types
?T
are now supported function_exists()
andmethod_exists()
permit calling tested symbol inside if body- Several improvements to a types inference
UNUSED
severity level is not used in non-LSP mode (#397)- Case-insensitive symbols handling is improved
Performance:
- Directory traversal speed is increased significantly (#333)
- Lexing became 5-10% faster due to
golex -> Ragel
switch (#381)
Bug fixes:
- PHP7 style nowdoc/heredoc are now parsed correctly (#327)
Documentation:
- Added Finding the false-positive document