Declarative Statements (PHP) is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Declarative Statements (PHP)
API ID: CountStmtDeclPhpLanguages: Web
Targets: Architectures, Classes, Files, Project
Number of PHP declarative statements.
For example:
<?php
// Compute a visitor count for this session
const SITE_NAME = "Understand Demo";
function nextVisit($count) {
return $count + 1;
}
$visits = 1;
$visits = nextVisit($visits);
echo "You are visitor number " . $visits . " to " . SITE_NAME;
const SITE_NAME = "Understand Demo"; (3) and function nextVisit($count) { ... } (5) are the two declarations, giving CountStmtDeclPhp = 2.
See Executable Statements (PHP) for the complementary breakdown, and Declarative Statements for the combined count across all languages.
Targets By Language:- Web: Project, File, PHP Class, PHP Interface
- This metric can be disabled from "Project Configuration/Metrics/Lines and Statements" with the "Show statement count metrics" option.
- This metric can be enabled from "Project Configuration/Metrics/Lines and Statements" with the "Breakdown counts by web language" option.