This document outlines the definition of file metrics for PHP.
The "complexity" metric counts:
if
andelse if
statements- ternary operators and nullish coalescing operators
for
andforeach
loopswhile
anddo...while
loopscase
labels in switch-statements- conditional expressions in
match
expressions catch
blocks- logical binary operations
&&
,||
andxor
- everything counted for the "functions" metric
It does not count:
goto
statements- any function calls
The "functions" metric counts:
- methods and functions in classes, abstract classes, interfaces, traits, enums (incl. constructors and destructors)
- lambda functions
- anonymous functions
The "classes" metric counts:
- definitions of
class
,abstract class
,interface
,trait
andenum
- anonymous classes
see README.md