@@ -68,12 +68,12 @@ final class CndParser extends AbstractParser
68
68
/**
69
69
* @var string[]
70
70
*/
71
- protected array $ namespaces = [];
71
+ private array $ namespaces = [];
72
72
73
73
/**
74
74
* @var string[]
75
75
*/
76
- protected array $ nodeTypes = [];
76
+ private array $ nodeTypes = [];
77
77
78
78
public function __construct (NodeTypeManagerInterface $ ntm )
79
79
{
@@ -142,7 +142,7 @@ private function parse(ReaderInterface $reader): array
142
142
* Prefix ::= String
143
143
* Uri ::= String
144
144
*/
145
- protected function parseNamespaceMapping (): void
145
+ private function parseNamespaceMapping (): void
146
146
{
147
147
$ this ->expectToken (Token::TK_SYMBOL , '< ' );
148
148
$ prefix = $ this ->parseCndString ();
@@ -162,7 +162,7 @@ protected function parseNamespaceMapping(): void
162
162
* [NodeTypeAttribute {NodeTypeAttribute}]
163
163
* {PropertyDef | ChildNodeDef}
164
164
*/
165
- protected function parseNodeType (): void
165
+ private function parseNodeType (): void
166
166
{
167
167
$ nodeType = $ this ->ntm ->createNodeTypeTemplate ();
168
168
$ this ->parseNodeTypeName ($ nodeType );
@@ -183,7 +183,7 @@ protected function parseNodeType(): void
183
183
*
184
184
* NodeTypeName ::= '[' String ']'
185
185
*/
186
- protected function parseNodeTypeName (NodeTypeTemplateInterface $ nodeType ): void
186
+ private function parseNodeTypeName (NodeTypeTemplateInterface $ nodeType ): void
187
187
{
188
188
$ this ->expectToken (Token::TK_SYMBOL , '[ ' );
189
189
$ name = $ this ->parseCndString ();
@@ -200,7 +200,7 @@ protected function parseNodeTypeName(NodeTypeTemplateInterface $nodeType): void
200
200
*
201
201
* Supertypes ::= '>' (StringList | '?')
202
202
*/
203
- protected function parseSupertypes (NodeTypeTemplateInterface $ nodeType ): void
203
+ private function parseSupertypes (NodeTypeTemplateInterface $ nodeType ): void
204
204
{
205
205
$ this ->expectToken (Token::TK_SYMBOL , '> ' );
206
206
@@ -243,7 +243,7 @@ protected function parseSupertypes(NodeTypeTemplateInterface $nodeType): void
243
243
* Query ::= ('noquery' | 'nq') | ('query' | 'q' )
244
244
* PrimaryItem ::= ('primaryitem'| '!')(String | '?')
245
245
*/
246
- protected function parseNodeTypeAttributes (NodeTypeTemplateInterface $ nodeType ): void
246
+ private function parseNodeTypeAttributes (NodeTypeTemplateInterface $ nodeType ): void
247
247
{
248
248
while (true ) {
249
249
if ($ this ->checkTokenIn (Token::TK_IDENTIFIER , $ this ->ORDERABLE )) {
@@ -284,7 +284,7 @@ protected function parseNodeTypeAttributes(NodeTypeTemplateInterface $nodeType):
284
284
*
285
285
* {PropertyDef | ChildNodeDef}
286
286
*/
287
- protected function parseChildrenAndAttributes (NodeTypeTemplateInterface $ nodeType ): void
287
+ private function parseChildrenAndAttributes (NodeTypeTemplateInterface $ nodeType ): void
288
288
{
289
289
while (true ) {
290
290
if ($ this ->checkToken (Token::TK_SYMBOL , '- ' )) {
@@ -310,7 +310,7 @@ protected function parseChildrenAndAttributes(NodeTypeTemplateInterface $nodeTyp
310
310
* [ValueConstraints]
311
311
* PropertyName ::= '-' String
312
312
*/
313
- protected function parsePropDef (NodeTypeTemplateInterface $ nodeType ): void
313
+ private function parsePropDef (NodeTypeTemplateInterface $ nodeType ): void
314
314
{
315
315
$ this ->expectToken (Token::TK_SYMBOL , '- ' );
316
316
@@ -364,7 +364,7 @@ protected function parsePropDef(NodeTypeTemplateInterface $nodeType): void
364
364
* 'DECIMAL' | 'URI' | 'UNDEFINED' | '*' |
365
365
* '?') ')'
366
366
*/
367
- protected function parsePropertyType (PropertyDefinitionTemplateInterface $ property ): void
367
+ private function parsePropertyType (PropertyDefinitionTemplateInterface $ property ): void
368
368
{
369
369
$ types = ['STRING ' , 'BINARY ' , 'LONG ' , 'DOUBLE ' , 'BOOLEAN ' , 'DATE ' , 'NAME ' , 'PATH ' ,
370
370
'REFERENCE ' , 'WEAKREFERENCE ' , 'DECIMAL ' , 'URI ' , 'UNDEFINED ' , '* ' , '? ' , ];
@@ -388,7 +388,7 @@ protected function parsePropertyType(PropertyDefinitionTemplateInterface $proper
388
388
*
389
389
* DefaultValues ::= '=' (StringList | '?')
390
390
*/
391
- protected function parseDefaultValue (PropertyDefinitionTemplateInterface $ property ): void
391
+ private function parseDefaultValue (PropertyDefinitionTemplateInterface $ property ): void
392
392
{
393
393
if ($ this ->checkAndExpectToken (Token::TK_SYMBOL , '? ' )) {
394
394
$ list = ['? ' ];
@@ -406,7 +406,7 @@ protected function parseDefaultValue(PropertyDefinitionTemplateInterface $proper
406
406
*
407
407
* ValueConstraints ::= '<' (StringList | '?')
408
408
*/
409
- protected function parseValueConstraints (PropertyDefinitionTemplateInterface $ property ): void
409
+ private function parseValueConstraints (PropertyDefinitionTemplateInterface $ property ): void
410
410
{
411
411
$ this ->expectToken (Token::TK_SYMBOL , '< ' );
412
412
@@ -473,7 +473,7 @@ protected function parseValueConstraints(PropertyDefinitionTemplateInterface $pr
473
473
* NoFullText ::= ('nofulltext' | 'nof') ['?']
474
474
* NoQueryOrder ::= ('noqueryorder' | 'nqord') ['?']
475
475
*/
476
- protected function parsePropertyAttributes (NodeTypeTemplateInterface $ parentType , PropertyDefinitionTemplateInterface $ property ): void
476
+ private function parsePropertyAttributes (NodeTypeTemplateInterface $ parentType , PropertyDefinitionTemplateInterface $ property ): void
477
477
{
478
478
$ opvSeen = false ;
479
479
while (true ) {
@@ -527,7 +527,7 @@ protected function parsePropertyAttributes(NodeTypeTemplateInterface $parentType
527
527
* RequiredTypes ::= '(' (StringList | '?') ')'
528
528
* DefaultType ::= '=' (String | '?')
529
529
*/
530
- protected function parseChildNodeDef (NodeTypeTemplateInterface $ nodeType ): void
530
+ private function parseChildNodeDef (NodeTypeTemplateInterface $ nodeType ): void
531
531
{
532
532
$ this ->expectToken (Token::TK_SYMBOL , '+ ' );
533
533
$ childType = $ this ->ntm ->createNodeDefinitionTemplate ();
@@ -593,7 +593,7 @@ protected function parseChildNodeDef(NodeTypeTemplateInterface $nodeType): void
593
593
* 'IGNORE' | 'ABORT' | ('OPV' '?')
594
594
* Sns ::= ('sns' | '*') ['?']
595
595
*/
596
- protected function parseChildNodeAttributes (
596
+ private function parseChildNodeAttributes (
597
597
NodeTypeTemplateInterface $ parentType ,
598
598
NodeDefinitionTemplateInterface $ childType
599
599
): void {
@@ -627,7 +627,7 @@ protected function parseChildNodeAttributes(
627
627
*
628
628
* @return string[]
629
629
*/
630
- protected function parseCndStringList (): array
630
+ private function parseCndStringList (): array
631
631
{
632
632
$ strings = [];
633
633
@@ -658,7 +658,7 @@ protected function parseCndStringList(): array
658
658
*
659
659
* TODO: check \n, \r, \t are valid in CND strings!
660
660
*/
661
- protected function parseCndString (): string
661
+ private function parseCndString (): string
662
662
{
663
663
$ string = '' ;
664
664
$ lastType = null ;
@@ -714,9 +714,9 @@ protected function parseCndString(): string
714
714
* (('''Operator {','Operator}''') | '?')
715
715
* Operator ::= '=' | '<>' | '<' | '<=' | '>' | '>=' | 'LIKE'
716
716
*
717
- * @return array
717
+ * @return array<bool|string>
718
718
*/
719
- protected function parseQueryOpsAttribute ()
719
+ private function parseQueryOpsAttribute (): array
720
720
{
721
721
if ($ this ->checkAndExpectToken (Token::TK_SYMBOL , '? ' )) {
722
722
// this denotes a variant, whatever that is
@@ -732,10 +732,7 @@ protected function parseQueryOpsAttribute()
732
732
return $ ops ;
733
733
}
734
734
735
- /**
736
- * Parse a query operator.
737
- */
738
- protected function parseQueryOperator (): bool |string
735
+ private function parseQueryOperator (): bool |string
739
736
{
740
737
$ token = $ this ->tokenQueue ->peek ();
741
738
$ data = $ token ->getData ();
0 commit comments