@@ -68,12 +68,12 @@ final class CndParser extends AbstractParser
6868 /**
6969 * @var string[]
7070 */
71- protected array $ namespaces = [];
71+ private array $ namespaces = [];
7272
7373 /**
7474 * @var string[]
7575 */
76- protected array $ nodeTypes = [];
76+ private array $ nodeTypes = [];
7777
7878 public function __construct (NodeTypeManagerInterface $ ntm )
7979 {
@@ -142,7 +142,7 @@ private function parse(ReaderInterface $reader): array
142142 * Prefix ::= String
143143 * Uri ::= String
144144 */
145- protected function parseNamespaceMapping (): void
145+ private function parseNamespaceMapping (): void
146146 {
147147 $ this ->expectToken (Token::TK_SYMBOL , '< ' );
148148 $ prefix = $ this ->parseCndString ();
@@ -162,7 +162,7 @@ protected function parseNamespaceMapping(): void
162162 * [NodeTypeAttribute {NodeTypeAttribute}]
163163 * {PropertyDef | ChildNodeDef}
164164 */
165- protected function parseNodeType (): void
165+ private function parseNodeType (): void
166166 {
167167 $ nodeType = $ this ->ntm ->createNodeTypeTemplate ();
168168 $ this ->parseNodeTypeName ($ nodeType );
@@ -183,7 +183,7 @@ protected function parseNodeType(): void
183183 *
184184 * NodeTypeName ::= '[' String ']'
185185 */
186- protected function parseNodeTypeName (NodeTypeTemplateInterface $ nodeType ): void
186+ private function parseNodeTypeName (NodeTypeTemplateInterface $ nodeType ): void
187187 {
188188 $ this ->expectToken (Token::TK_SYMBOL , '[ ' );
189189 $ name = $ this ->parseCndString ();
@@ -200,7 +200,7 @@ protected function parseNodeTypeName(NodeTypeTemplateInterface $nodeType): void
200200 *
201201 * Supertypes ::= '>' (StringList | '?')
202202 */
203- protected function parseSupertypes (NodeTypeTemplateInterface $ nodeType ): void
203+ private function parseSupertypes (NodeTypeTemplateInterface $ nodeType ): void
204204 {
205205 $ this ->expectToken (Token::TK_SYMBOL , '> ' );
206206
@@ -243,7 +243,7 @@ protected function parseSupertypes(NodeTypeTemplateInterface $nodeType): void
243243 * Query ::= ('noquery' | 'nq') | ('query' | 'q' )
244244 * PrimaryItem ::= ('primaryitem'| '!')(String | '?')
245245 */
246- protected function parseNodeTypeAttributes (NodeTypeTemplateInterface $ nodeType ): void
246+ private function parseNodeTypeAttributes (NodeTypeTemplateInterface $ nodeType ): void
247247 {
248248 while (true ) {
249249 if ($ this ->checkTokenIn (Token::TK_IDENTIFIER , $ this ->ORDERABLE )) {
@@ -284,7 +284,7 @@ protected function parseNodeTypeAttributes(NodeTypeTemplateInterface $nodeType):
284284 *
285285 * {PropertyDef | ChildNodeDef}
286286 */
287- protected function parseChildrenAndAttributes (NodeTypeTemplateInterface $ nodeType ): void
287+ private function parseChildrenAndAttributes (NodeTypeTemplateInterface $ nodeType ): void
288288 {
289289 while (true ) {
290290 if ($ this ->checkToken (Token::TK_SYMBOL , '- ' )) {
@@ -310,7 +310,7 @@ protected function parseChildrenAndAttributes(NodeTypeTemplateInterface $nodeTyp
310310 * [ValueConstraints]
311311 * PropertyName ::= '-' String
312312 */
313- protected function parsePropDef (NodeTypeTemplateInterface $ nodeType ): void
313+ private function parsePropDef (NodeTypeTemplateInterface $ nodeType ): void
314314 {
315315 $ this ->expectToken (Token::TK_SYMBOL , '- ' );
316316
@@ -364,7 +364,7 @@ protected function parsePropDef(NodeTypeTemplateInterface $nodeType): void
364364 * 'DECIMAL' | 'URI' | 'UNDEFINED' | '*' |
365365 * '?') ')'
366366 */
367- protected function parsePropertyType (PropertyDefinitionTemplateInterface $ property ): void
367+ private function parsePropertyType (PropertyDefinitionTemplateInterface $ property ): void
368368 {
369369 $ types = ['STRING ' , 'BINARY ' , 'LONG ' , 'DOUBLE ' , 'BOOLEAN ' , 'DATE ' , 'NAME ' , 'PATH ' ,
370370 'REFERENCE ' , 'WEAKREFERENCE ' , 'DECIMAL ' , 'URI ' , 'UNDEFINED ' , '* ' , '? ' , ];
@@ -388,7 +388,7 @@ protected function parsePropertyType(PropertyDefinitionTemplateInterface $proper
388388 *
389389 * DefaultValues ::= '=' (StringList | '?')
390390 */
391- protected function parseDefaultValue (PropertyDefinitionTemplateInterface $ property ): void
391+ private function parseDefaultValue (PropertyDefinitionTemplateInterface $ property ): void
392392 {
393393 if ($ this ->checkAndExpectToken (Token::TK_SYMBOL , '? ' )) {
394394 $ list = ['? ' ];
@@ -406,7 +406,7 @@ protected function parseDefaultValue(PropertyDefinitionTemplateInterface $proper
406406 *
407407 * ValueConstraints ::= '<' (StringList | '?')
408408 */
409- protected function parseValueConstraints (PropertyDefinitionTemplateInterface $ property ): void
409+ private function parseValueConstraints (PropertyDefinitionTemplateInterface $ property ): void
410410 {
411411 $ this ->expectToken (Token::TK_SYMBOL , '< ' );
412412
@@ -473,7 +473,7 @@ protected function parseValueConstraints(PropertyDefinitionTemplateInterface $pr
473473 * NoFullText ::= ('nofulltext' | 'nof') ['?']
474474 * NoQueryOrder ::= ('noqueryorder' | 'nqord') ['?']
475475 */
476- protected function parsePropertyAttributes (NodeTypeTemplateInterface $ parentType , PropertyDefinitionTemplateInterface $ property ): void
476+ private function parsePropertyAttributes (NodeTypeTemplateInterface $ parentType , PropertyDefinitionTemplateInterface $ property ): void
477477 {
478478 $ opvSeen = false ;
479479 while (true ) {
@@ -527,7 +527,7 @@ protected function parsePropertyAttributes(NodeTypeTemplateInterface $parentType
527527 * RequiredTypes ::= '(' (StringList | '?') ')'
528528 * DefaultType ::= '=' (String | '?')
529529 */
530- protected function parseChildNodeDef (NodeTypeTemplateInterface $ nodeType ): void
530+ private function parseChildNodeDef (NodeTypeTemplateInterface $ nodeType ): void
531531 {
532532 $ this ->expectToken (Token::TK_SYMBOL , '+ ' );
533533 $ childType = $ this ->ntm ->createNodeDefinitionTemplate ();
@@ -593,7 +593,7 @@ protected function parseChildNodeDef(NodeTypeTemplateInterface $nodeType): void
593593 * 'IGNORE' | 'ABORT' | ('OPV' '?')
594594 * Sns ::= ('sns' | '*') ['?']
595595 */
596- protected function parseChildNodeAttributes (
596+ private function parseChildNodeAttributes (
597597 NodeTypeTemplateInterface $ parentType ,
598598 NodeDefinitionTemplateInterface $ childType
599599 ): void {
@@ -627,7 +627,7 @@ protected function parseChildNodeAttributes(
627627 *
628628 * @return string[]
629629 */
630- protected function parseCndStringList (): array
630+ private function parseCndStringList (): array
631631 {
632632 $ strings = [];
633633
@@ -658,7 +658,7 @@ protected function parseCndStringList(): array
658658 *
659659 * TODO: check \n, \r, \t are valid in CND strings!
660660 */
661- protected function parseCndString (): string
661+ private function parseCndString (): string
662662 {
663663 $ string = '' ;
664664 $ lastType = null ;
@@ -714,9 +714,9 @@ protected function parseCndString(): string
714714 * (('''Operator {','Operator}''') | '?')
715715 * Operator ::= '=' | '<>' | '<' | '<=' | '>' | '>=' | 'LIKE'
716716 *
717- * @return array
717+ * @return array<bool|string>
718718 */
719- protected function parseQueryOpsAttribute ()
719+ private function parseQueryOpsAttribute (): array
720720 {
721721 if ($ this ->checkAndExpectToken (Token::TK_SYMBOL , '? ' )) {
722722 // this denotes a variant, whatever that is
@@ -732,10 +732,7 @@ protected function parseQueryOpsAttribute()
732732 return $ ops ;
733733 }
734734
735- /**
736- * Parse a query operator.
737- */
738- protected function parseQueryOperator (): bool |string
735+ private function parseQueryOperator (): bool |string
739736 {
740737 $ token = $ this ->tokenQueue ->peek ();
741738 $ data = $ token ->getData ();
0 commit comments