3636class CndParser extends AbstractParser
3737{
3838 // node type attributes
39- private $ ORDERABLE = array ( 'o ' , 'ord ' , 'orderable ' ) ;//, 'variant' => true);
40- private $ MIXIN = array ( 'm ' , 'mix ' , 'mixin ' ) ;//, 'variant' => true);
41- private $ ABSTRACT = array ( 'a ' , 'abs ' , 'abstract ' ) ;//, 'variant' => true);
42- private $ NOQUERY = array ( 'noquery ' , 'nq ' ) ;//, 'variant' => false);
43- private $ QUERY = array ( 'query ' , 'q ' ) ;//, 'variant' => false);
44- private $ PRIMARYITEM = array ( 'primaryitem ' , '! ' ) ;//, 'variant' => false);
39+ private $ ORDERABLE = [ 'o ' , 'ord ' , 'orderable ' ] ;//, 'variant' => true);
40+ private $ MIXIN = [ 'm ' , 'mix ' , 'mixin ' ] ;//, 'variant' => true);
41+ private $ ABSTRACT = [ 'a ' , 'abs ' , 'abstract ' ] ;//, 'variant' => true);
42+ private $ NOQUERY = [ 'noquery ' , 'nq ' ] ;//, 'variant' => false);
43+ private $ QUERY = [ 'query ' , 'q ' ] ;//, 'variant' => false);
44+ private $ PRIMARYITEM = [ 'primaryitem ' , '! ' ] ;//, 'variant' => false);
4545
4646 // common for properties and child definitions
47- private $ PRIMARY = array ( '! ' , 'pri ' , 'primary ' ) ; //, 'variant' => true),
48- private $ AUTOCREATED = array ( 'a ' , 'aut ' , 'autocreated ' ) ; //, 'variant' => true),
49- private $ MANDATORY = array ( 'm ' , 'man ' , 'mandatory ' ) ; //, 'variant' => true),
50- private $ PROTECTED = array ( 'p ' , 'pro ' , 'protected ' ) ; //, 'variant' => true),
51- private $ OPV = array ( 'COPY ' , 'VERSION ' , 'INITIALIZE ' , 'COMPUTE ' , 'IGNORE ' , 'ABORT ' ) ;
47+ private $ PRIMARY = [ '! ' , 'pri ' , 'primary ' ] ; //, 'variant' => true),
48+ private $ AUTOCREATED = [ 'a ' , 'aut ' , 'autocreated ' ] ; //, 'variant' => true),
49+ private $ MANDATORY = [ 'm ' , 'man ' , 'mandatory ' ] ; //, 'variant' => true),
50+ private $ PROTECTED = [ 'p ' , 'pro ' , 'protected ' ] ; //, 'variant' => true),
51+ private $ OPV = [ 'COPY ' , 'VERSION ' , 'INITIALIZE ' , 'COMPUTE ' , 'IGNORE ' , 'ABORT ' ] ;
5252
5353 // property type attributes
54- private $ MULTIPLE = array ( '* ' , 'mul ' , 'multiple ' ) ; //, 'variant' => true),
55- private $ QUERYOPS = array ( 'qop ' , 'queryops ' ) ; //, 'variant' => true), // Needs special handling !
56- private $ NOFULLTEXT = array ( 'nof ' , 'nofulltext ' ) ; //, 'variant' => true),
57- private $ NOQUERYORDER = array ( 'nqord ' , 'noqueryorder ' ) ; //, 'variant' => true),
54+ private $ MULTIPLE = [ '* ' , 'mul ' , 'multiple ' ] ; //, 'variant' => true),
55+ private $ QUERYOPS = [ 'qop ' , 'queryops ' ] ; //, 'variant' => true), // Needs special handling !
56+ private $ NOFULLTEXT = [ 'nof ' , 'nofulltext ' ] ; //, 'variant' => true),
57+ private $ NOQUERYORDER = [ 'nqord ' , 'noqueryorder ' ] ; //, 'variant' => true),
5858
5959 // child node attributes
6060 // multiple is actually a jackrabbit specific synonym for sns
6161 // http://www.mail-archive.com/users@jackrabbit.apache.org/msg19268.html
62- private $ SNS = array ( '* ' , 'sns ' , 'multiple ' ) ; //, 'variant' => true),
62+ private $ SNS = [ '* ' , 'sns ' , 'multiple ' ] ; //, 'variant' => true),
6363
6464 /**
6565 * @var NodeTypeManagerInterface
@@ -69,12 +69,12 @@ class CndParser extends AbstractParser
6969 /**
7070 * @var array
7171 */
72- protected $ namespaces = array () ;
72+ protected $ namespaces = [] ;
7373
7474 /**
7575 * @var array
7676 */
77- protected $ nodeTypes = array () ;
77+ protected $ nodeTypes = [] ;
7878
7979 /**
8080 * @param NodeTypeManagerInterface $ntm
@@ -129,10 +129,10 @@ private function parse(ReaderInterface $reader)
129129 }
130130 }
131131
132- return array (
132+ return [
133133 'namespaces ' => $ this ->namespaces ,
134134 'nodeTypes ' => $ this ->nodeTypes ,
135- ) ;
135+ ] ;
136136 }
137137
138138 /**
@@ -208,7 +208,7 @@ protected function parseSupertypes(NodeTypeTemplateInterface $nodeType)
208208 $ this ->expectToken (Token::TK_SYMBOL , '> ' );
209209
210210 if ($ this ->checkAndExpectToken (Token::TK_SYMBOL , '? ' )) {
211- $ nodeType ->setDeclaredSuperTypeNames (array ( '? ' ) );
211+ $ nodeType ->setDeclaredSuperTypeNames ([ '? ' ] );
212212 } else {
213213 $ nodeType ->setDeclaredSuperTypeNames ($ this ->parseCndStringList ());
214214 }
@@ -369,8 +369,8 @@ protected function parsePropDef(NodeTypeTemplateInterface $nodeType)
369369 */
370370 protected function parsePropertyType (PropertyDefinitionTemplateInterface $ property )
371371 {
372- $ types = array ( "STRING " , "BINARY " , "LONG " , "DOUBLE " , "BOOLEAN " , "DATE " , "NAME " , "PATH " ,
373- "REFERENCE " , "WEAKREFERENCE " , "DECIMAL " , "URI " , "UNDEFINED " , "* " , "? " ) ;
372+ $ types = [ "STRING " , "BINARY " , "LONG " , "DOUBLE " , "BOOLEAN " , "DATE " , "NAME " , "PATH " ,
373+ "REFERENCE " , "WEAKREFERENCE " , "DECIMAL " , "URI " , "UNDEFINED " , "* " , "? " ] ;
374374
375375 if (! $ this ->checkTokenIn (Token::TK_IDENTIFIER , $ types , true )) {
376376 throw new ParserException ($ this ->tokenQueue , sprintf ("Invalid property type: %s " , $ this ->tokenQueue ->get ()->getData ()));
@@ -394,7 +394,7 @@ protected function parsePropertyType(PropertyDefinitionTemplateInterface $proper
394394 protected function parseDefaultValue (PropertyDefinitionTemplateInterface $ property )
395395 {
396396 if ($ this ->checkAndExpectToken (Token::TK_SYMBOL , '? ' )) {
397- $ list = array ( '? ' ) ;
397+ $ list = [ '? ' ] ;
398398 } else {
399399 $ list = $ this ->parseCndStringList ();
400400 }
@@ -414,7 +414,7 @@ protected function parseValueConstraints(PropertyDefinitionTemplateInterface $pr
414414 $ this ->expectToken (Token::TK_SYMBOL , '< ' );
415415
416416 if ($ this ->checkAndExpectToken (Token::TK_SYMBOL , '? ' )) {
417- $ list = array ( '? ' ) ;
417+ $ list = [ '? ' ] ;
418418 } else {
419419 $ list = $ this ->parseCndStringList ();
420420 }
@@ -632,7 +632,7 @@ protected function parseChildNodeAttributes(
632632 */
633633 protected function parseCndStringList ()
634634 {
635- $ strings = array () ;
635+ $ strings = [] ;
636636
637637 $ strings [] = $ this ->parseCndString ();
638638 while ($ this ->checkAndExpectToken (Token::TK_SYMBOL , ', ' )) {
@@ -728,7 +728,7 @@ protected function parseQueryOpsAttribute()
728728 throw new ParserException ($ this ->tokenQueue , 'TODO: understand what "variant" means ' );
729729 }
730730
731- $ ops = array () ;
731+ $ ops = [] ;
732732 do {
733733 $ op = $ this ->parseQueryOperator ();
734734 $ ops [] = $ op ;
0 commit comments