11<?php
22 class Property
33 {
4- public $ line ; // number, line number in the source file this is found on?
5- public $ name ; // visible, name, parent
6- public $ types = []; // an array containing all possible types it can be: string, number, etc
7- public $ default = false ; // assigned value is the default value
4+ public $ line ; // number, line number in the source file this is found on
5+ public $ name ; // visible, name, parent
6+ public $ types = []; // an array containing all possible types it can be: string, number, etc
7+ public $ default = null ; // assigned value is the default value
88 public $ help = [];
99 public $ inlineHelp = '' ;
1010
1111 public $ isPublic = true ;
1212 public $ isProtected = false ;
1313 public $ isPrivate = false ;
14-
1514 public $ isReadOnly = false ;
1615
16+ public $ corrupted = false ;
17+
1718 public function __construct ($ block )
1819 {
1920 // Because zero offset + allowing for final line
@@ -23,12 +24,19 @@ public function __construct($block)
2324
2425 if (count ($ output ) > 3 )
2526 {
26- $ this ->parsePhaser ($ output , $ block );
27+ $ result = $ this ->parsePhaser ($ output , $ block );
2728 }
2829 else
2930 {
3031 preg_match ("/(@.*) (.*)/ " , $ block ->getLine ('@property ' ), $ output );
31- $ this ->parsePixi ($ output , $ block );
32+ $ result = $ this ->parsePixi ($ output , $ block );
33+ }
34+
35+ if ($ result === false )
36+ {
37+ // Bail out, tell the Process we've a duff Property here
38+ $ this ->corrupted = true ;
39+ return false ;
3240 }
3341
3442 if ($ block ->getTypeBoolean ('@protected ' ))
@@ -42,13 +50,15 @@ public function __construct($block)
4250 $ this ->isPrivate = true ;
4351 }
4452
45- if ($ block ->getTypeBoolean ('@readonly ' ))
53+ if ($ block ->getTypeBoolean ('@readonly ' ) || $ block -> getTypeBoolean ( ' @readOnly ' ) )
4654 {
4755 $ this ->isReadOnly = true ;
4856 }
4957
5058 $ this ->help = $ block ->cleanContent ();
5159
60+ return true ;
61+
5262 }
5363
5464 public function parsePhaser ($ output , $ block )
@@ -68,11 +78,20 @@ public function parsePhaser($output, $block)
6878 }
6979 }
7080
81+ return true ;
82+
7183 }
7284
7385 public function parsePixi ($ output , $ block )
7486 {
75- $ this ->name = $ output [2 ];
87+ if (isset ($ output [2 ]))
88+ {
89+ $ this ->name = $ output [2 ];
90+ }
91+ else
92+ {
93+ return false ;
94+ }
7695
7796 if ($ block ->getTypeBoolean ('@type ' ))
7897 {
@@ -84,6 +103,8 @@ public function parsePixi($output, $block)
84103 $ this ->default = $ block ->getTag ('@default ' );
85104 }
86105
106+ return true ;
107+
87108 }
88109
89110 public function getArray ()
0 commit comments