Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
ParseErrorCode
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Html\Tokenizer;
6
7/**
8 * Named parse-error codes per WHATWG ยง13.2.5. Each error case has a
9 * specification-defined identifier; we mirror those identifiers so logs and
10 * diagnostics line up with the spec's terminology.
11 *
12 * Only the codes the implemented states can emit are present. Adding a new
13 * state (Phase 1B.2-bis) extends this enum additively.
14 */
15enum ParseErrorCode: string
16{
17    case AbruptClosingOfEmptyComment = 'abrupt-closing-of-empty-comment';
18    case AbruptDoctypePublicIdentifier = 'abrupt-doctype-public-identifier';
19    case AbruptDoctypeSystemIdentifier = 'abrupt-doctype-system-identifier';
20    case AbsenceOfDigitsInNumericCharacterReference = 'absence-of-digits-in-numeric-character-reference';
21    case CdataInHtmlContent = 'cdata-in-html-content';
22    case CharacterReferenceOutsideUnicodeRange = 'character-reference-outside-unicode-range';
23    case ControlCharacterInInputStream = 'control-character-in-input-stream';
24    case ControlCharacterReference = 'control-character-reference';
25    case EndTagWithAttributes = 'end-tag-with-attributes';
26    case EndTagWithTrailingSolidus = 'end-tag-with-trailing-solidus';
27    case EofBeforeTagName = 'eof-before-tag-name';
28    case EofInCdata = 'eof-in-cdata';
29    case EofInComment = 'eof-in-comment';
30    case EofInDoctype = 'eof-in-doctype';
31    case EofInScriptHtmlCommentLikeText = 'eof-in-script-html-comment-like-text';
32    case EofInTag = 'eof-in-tag';
33    case IncorrectlyClosedComment = 'incorrectly-closed-comment';
34    case IncorrectlyOpenedComment = 'incorrectly-opened-comment';
35    case InvalidCharacterSequenceAfterDoctypeName = 'invalid-character-sequence-after-doctype-name';
36    case InvalidFirstCharacterOfTagName = 'invalid-first-character-of-tag-name';
37    case MissingAttributeValue = 'missing-attribute-value';
38    case MissingDoctypeName = 'missing-doctype-name';
39    case MissingDoctypePublicIdentifier = 'missing-doctype-public-identifier';
40    case MissingDoctypeSystemIdentifier = 'missing-doctype-system-identifier';
41    case MissingEndTagName = 'missing-end-tag-name';
42    case MissingQuoteBeforeDoctypePublicIdentifier = 'missing-quote-before-doctype-public-identifier';
43    case MissingQuoteBeforeDoctypeSystemIdentifier = 'missing-quote-before-doctype-system-identifier';
44    case MissingSemicolonAfterCharacterReference = 'missing-semicolon-after-character-reference';
45    case MissingWhitespaceAfterDoctypePublicKeyword = 'missing-whitespace-after-doctype-public-keyword';
46    case MissingWhitespaceAfterDoctypeSystemKeyword = 'missing-whitespace-after-doctype-system-keyword';
47    case MissingWhitespaceBeforeDoctypeName = 'missing-whitespace-before-doctype-name';
48    case MissingWhitespaceBetweenAttributes = 'missing-whitespace-between-attributes';
49    case MissingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = 'missing-whitespace-between-doctype-public-and-system-identifiers';
50    case NestedComment = 'nested-comment';
51    case NoncharacterCharacterReference = 'noncharacter-character-reference';
52    case NoncharacterInInputStream = 'noncharacter-in-input-stream';
53    case NullCharacterReference = 'null-character-reference';
54    case SurrogateCharacterReference = 'surrogate-character-reference';
55    case SurrogateInInputStream = 'surrogate-in-input-stream';
56    case UnexpectedCharacterAfterDoctypeSystemIdentifier = 'unexpected-character-after-doctype-system-identifier';
57    case UnexpectedCharacterInAttributeName = 'unexpected-character-in-attribute-name';
58    case UnexpectedCharacterInUnquotedAttributeValue = 'unexpected-character-in-unquoted-attribute-value';
59    case UnexpectedEqualsSignBeforeAttributeName = 'unexpected-equals-sign-before-attribute-name';
60    case UnexpectedNullCharacter = 'unexpected-null-character';
61    case UnexpectedQuestionMarkInsteadOfTagName = 'unexpected-question-mark-instead-of-tag-name';
62    case UnexpectedSolidusInTag = 'unexpected-solidus-in-tag';
63    case UnknownNamedCharacterReference = 'unknown-named-character-reference';
64}