Skip to content

S008 Edge Cases

IDScenarioExpected Behavior
S008-EC-001No source files exist in any configured structure (all source directories are empty or contain no .php files)Each structure produces an empty table (no file rows). No enforced failures. Exit code 0. In JSON mode, structures[].files arrays are empty, "passed": true.
S008-EC-002All source files are missing their corresponding test files (every file fails test-exists)Every file row shows N (red) in the test-exists column and N (red) in the OK column. Exit code 1. In JSON mode, every file has "passed": false and rules["test-exists"]["passed"]: false.
S008-EC-003Zero enforced rules are active (only informational rules like coverage-attribution are configured, plus test-exists is auto-prepended but hypothetically if all rules returned isEnforced() === false)All OK columns show Y (green) because no enforced rule fails. Exit code 0 (unless global coverage threshold is breached). In JSON mode, all file entries have "passed": true. The $hasFailure boolean remains false.
S008-EC-004Source files exist at the root of the source directory (no subdirectories)No directory separator rows are rendered. File rows have no leading two-space indent in Source/Test columns. The directory is . which is suppressed. Files are still sorted alphabetically.
S008-EC-005A custom plugin rule returns null from columnHeader()That rule does not generate a table column. Its results still appear in JSON output under the rules object keyed by name(). The rule still participates in OK column computation if isEnforced() is true.
S008-EC-006All per-file enforced rules pass but global coverage is below min_coverage_globalIn table mode, the error message Global coverage {n}% is below minimum {m}%. is displayed. The summary table shows FAIL for Global coverage. Exit code is 1. In JSON mode, "passed": false despite all file-level entries having "passed": true.
S008-EC-007A structure entry's source directory does not exist on diskA warning Source path does not exist: {path} is printed in table mode. The structure is skipped (no table rendered). In JSON mode, the structure still appears in the structures array but with an empty files array. The missing directory does not count as a failure.
S008-EC-008The structure array in config is empty (structure: [])The warning No structure entries in parity.yaml. is printed. Exit code 0. In JSON mode, structures is an empty array, "passed": true (assuming no global coverage violation).
S008-EC-009File paths exceed typical terminal width (e.g., deeply nested app/Domain/Context/SubContext/Services/Implementation/AuthenticationService.php)Table rendering delegates to Symfony Console which handles column widths. No truncation is applied by Parity. Long paths may cause table wrapping depending on terminal width. JSON output is unaffected.
S008-EC-010Only informational rules are configured (e.g., only coverage-attribution plus auto-prepended test-exists which is enforced)The test-exists rule is always auto-prepended and is enforced. If tests exist for all files, exit code is 0. The informational rule results appear in the table and JSON but do not affect the OK column or exit code.
S008-EC-011File paths contain Unicode characters (e.g., app/Services/UeberService.php with umlauts or accented characters)Table rendering passes through Unicode without modification. JSON output uses PHP's json_encode which handles UTF-8 natively. No encoding errors occur.
S008-EC-012min_coverage_global is not configured (null) and global coverage data may or may not be availableThe global coverage info/error message is not displayed in table mode (the $minCoverageGlobal !== null guard prevents it). In JSON mode, "global_coverage" is a number or null, "min_coverage_global" is null. Global coverage does not affect "passed" or exit code when the threshold is null.
S008-EC-013A file's coverage percentage is exactly equal to the min_coverage threshold (e.g., 80.0% with min: 80)The >= comparison in MinimumCoverageRule means the file passes. The cell displays green. Exit code is 0 (assuming no other failures). In JSON, rules["minimum-coverage"]["passed"]: true.
S008-EC-014The --format flag is given with an unsupported value (e.g., --format=csv, --format=xml)The value is not json, so $isJson evaluates to false. The command falls through to table mode. No explicit validation error is raised. The unsupported format value is silently ignored.
S008-EC-015Structures override the top-level min_coverage or min_matched_coverage with different thresholdsSummary Required cells show Per rule; summary status aggregates the evaluated rule results and therefore matches the file rows and exit code.
S008-EC-016A coverage report includes files with zero executable linesExclude those files from summary minimum and average values when executable-line metadata is available. Continue displaying their individual file rows.
S008-EC-017A global threshold is configured but the selected report has no global coverage valueDisplay -- for Global value and status. Do not fail solely because the report omitted a global value.