Skip to content

passCodeMsg

Corey Avis edited this page Sep 23, 2026 · 2 revisions

passCodeMsg [Protected]

Determines the descriptive status message for an individual password attribute score.

This is a helper method used within the password strength engine. The engine evaluates individual criteria (e.g., length, uppercase density, numeric count, and symbol presense), assigns a numeric score to each, and passes that score here to retrieve a user-friendly feedback string.

Usage

passCodeMsg(integer $code): string

Parameters

code (integer) : The numeric score generated by a specific password rule validation. (default: 'Undefined')

Return Value

(string) : Returns a descriptive label representing the evaluation of the score.

Score Code Return Value Context / Meaning
-2 N/A Not Applicable (e.g., does not apply).
-1 Fail Critical Failure (e.g., fails to meet standards).
0 Warning Extremely Weak (e.g., does not meet minimums or requirements).
1 Good Meets minimum requirements, but room for improvement.
2 Great Strong metric (e.g. contains a highly diverse mix of characters).
3 Pass Optimal strength achieved for this category.
Any other value Undefined Fallback safety net for unexpected scoring outputs.

Examples

$sec->passCodeMsg(3) = Pass

Debug Errors

  • No debug errors.

Home | CoreySecurity | Helpers

Clone this wiki locally