2424
2525final class QuoteParser implements InlineParserInterface
2626{
27+ /**
28+ * @deprecated This constant is no longer used and will be removed in a future major release
29+ */
2730 public const DOUBLE_QUOTES = [Quote::DOUBLE_QUOTE , Quote::DOUBLE_QUOTE_OPENER , Quote::DOUBLE_QUOTE_CLOSER ];
31+
32+ /**
33+ * @deprecated This constant is no longer used and will be removed in a future major release
34+ */
2835 public const SINGLE_QUOTES = [Quote::SINGLE_QUOTE , Quote::SINGLE_QUOTE_OPENER , Quote::SINGLE_QUOTE_CLOSER ];
2936
3037 public function getMatchDefinition (): InlineParserMatch
3138 {
32- return InlineParserMatch::oneOf (...[... self :: DOUBLE_QUOTES , ... self :: SINGLE_QUOTES ] );
39+ return InlineParserMatch::oneOf (Quote:: SINGLE_QUOTE , Quote:: DOUBLE_QUOTE );
3340 }
3441
3542 /**
@@ -40,8 +47,6 @@ public function parse(InlineParserContext $inlineContext): bool
4047 $ char = $ inlineContext ->getFullMatch ();
4148 $ cursor = $ inlineContext ->getCursor ();
4249
43- $ normalizedCharacter = $ this ->getNormalizedQuoteCharacter ($ char );
44-
4550 $ charBefore = $ cursor ->peek (-1 );
4651 if ($ charBefore === null ) {
4752 $ charBefore = "\n" ;
@@ -58,28 +63,15 @@ public function parse(InlineParserContext $inlineContext): bool
5863 $ canOpen = $ leftFlanking && ! $ rightFlanking ;
5964 $ canClose = $ rightFlanking ;
6065
61- $ node = new Quote ($ normalizedCharacter , ['delim ' => true ]);
66+ $ node = new Quote ($ char , ['delim ' => true ]);
6267 $ inlineContext ->getContainer ()->appendChild ($ node );
6368
6469 // Add entry to stack to this opener
65- $ inlineContext ->getDelimiterStack ()->push (new Delimiter ($ normalizedCharacter , 1 , $ node , $ canOpen , $ canClose ));
70+ $ inlineContext ->getDelimiterStack ()->push (new Delimiter ($ char , 1 , $ node , $ canOpen , $ canClose ));
6671
6772 return true ;
6873 }
6974
70- private function getNormalizedQuoteCharacter (string $ character ): string
71- {
72- if (\in_array ($ character , self ::DOUBLE_QUOTES , true )) {
73- return Quote::DOUBLE_QUOTE ;
74- }
75-
76- if (\in_array ($ character , self ::SINGLE_QUOTES , true )) {
77- return Quote::SINGLE_QUOTE ;
78- }
79-
80- return $ character ;
81- }
82-
8375 /**
8476 * @return bool[]
8577 */
0 commit comments