Skip to content

Reference

phil/accessibility-check

Checking

TypeRole
AccessibilityCheckerRuns the rules the policy keeps over HTML (checkHtml()) or a UJO document (checkUjo()), and returns a Report
PolicyLimits, headings, contrast and colours, colour tokens, language, generic link texts, rules turned off or given another severity, locale
HeadingPolicySingle, None or Any: the first-level headings a content may hold
ContrastLevelAA or AAA: the contrast ratios required, and their success criterion
SeverityError, Warning or Notice, with isAtLeast()
SuccessCriterionThe 86 success criteria of WCAG 2.2 by number, with title(), level() and understandingUrl()
ConformanceLevelA, AA or AAA

The report

TypeRole
ReportThe outcome of each rule and the findings, filtered, translated and serialized to JSON
RuleResultThe outcome of one rule: identifier, criterion, severity, number of findings, passed()
FindingOne problem: rule, criterion, severity, message, location
LocationWhere a finding is: line, element path and snippet in HTML; block, type and pointer in UJO
MessageA key of the domain phil_accessibility_check and the values of its placeholders
ViolationWhat a rule yields: a location, a message, and its own severity or criterion when it has one

Rules

TypeRole
Contract\RuleIdentifier, success criterion and severity of a rule
Contract\HtmlRuleA rule that reads HTML
Contract\UjoRuleA rule that reads UJO documents
Rule\DefaultRulesThe fifteen rules of the library, in the order they run
Rule\FragmentRuleThe base of a rule that reads the data of each block, then each of its HTML fields
Rule\ImageAlt, HeadingOrder, HeadingH1, EmptyHeading, LinkName, ButtonName, LinkText, ColorContrast, TableHeaders, HtmlLang, LangChange, FrameTitle, VideoCaptions, DuplicateId, SvgNameThe rules: see Rules
Rule\HeadingA heading of a content, from HTML or from UJO
Rule\FileNameWhether a text alternative is a file name
Rule\GenericLinkTextThe generic link texts of six languages, and how a link name is compared with them

Reading

TypeRole
Html\HtmlTargetHTML parsed and indexed, with what the rules ask of an element
Ujo\UjoTargetA UJO document as the rules read it: its blocks and its HTML fields
Ujo\UjoReaderWalks the blocks and their data for UjoTarget
Ujo\BlockVisitA block as the check meets it: its pointer and its language
Ujo\FragmentAn HTML field of a block, parsed
Ujo\PlainFieldsThe fields of block data that never hold HTML
Colour\ColourA colour of sRGB, with the relative luminance and the contrast ratio of WCAG
Colour\ColourParserReads the colours of CSS
Language\LanguageTagWhether a language tag of BCP 47 is well formed, and its primary language

Messages

TypeRole
Translation\MessagesThe messages for symfony/translation: resources(), translator(), translate(), locale()
Translation\English, French, Spanish, German, Italian, PortugueseThe messages of each language

Symfony

TypeRole
Validator\AccessibleContent, AccessibleContentValidatorThe constraint and its validator
Workflow\PublicationGuardThe guard that holds back a publication
Contract\SubjectContentThe content of the subject of a workflow, for the guard
Console\CheckCommandThe command phil:accessibility:check

Exceptions

TypeRole
Exception\AccessibilityCheckExceptionImplemented by every exception of the library
Exception\InvalidPolicyA policy or a set of rules that cannot be used
Exception\LimitExceededA content over a limit of the policy
Exception\InvalidContentHTML that is not UTF-8