@@ -9,6 +9,8 @@ class Processor
99 public $ methods ;
1010 public $ properties ;
1111
12+ public $ processLog ;
13+
1214 /**
1315 * Processes the given JS source file.
1416 *
@@ -25,6 +27,19 @@ public function __construct($file)
2527 $ this ->scanFile ();
2628 }
2729
30+ public function log ($ text ) {
31+
32+ $ this ->processLog [] = $ text ;
33+
34+ }
35+
36+ public function getLog () {
37+
38+ return $ this ->processLog ;
39+ // return array_reverse($this->processLog);
40+
41+ }
42+
2843 /**
2944 * Scans the given JS source file and extracts blocks from it
3045 */
@@ -77,21 +92,23 @@ private function scanFile() {
7792 {
7893 if ($ this ->blocks [$ i ]->isClass )
7994 {
80- $ this ->class = new ClassDesc ($ this ->blocks [$ i ]);
95+ $ this ->class = new ClassDesc ($ this , $ this ->blocks [$ i ]);
8196 }
8297 else if ($ this ->blocks [$ i ]->isConst )
8398 {
84- $ tempConst = new Constant ($ this ->blocks [$ i ]);
99+ $ tempConst = new Constant ($ this , $ this ->blocks [$ i ]);
100+
85101 $ this ->consts [$ tempConst ->name ] = $ tempConst ;
86102 }
87103 else if ($ this ->blocks [$ i ]->isMethod )
88104 {
89- $ tempMethod = new Method ($ this ->blocks [$ i ]);
105+ $ tempMethod = new Method ($ this , $ this ->blocks [$ i ]);
106+
90107 $ this ->methods [$ tempMethod ->name ] = $ tempMethod ;
91108 }
92109 else if ($ this ->blocks [$ i ]->isProperty )
93110 {
94- $ tempProperty = new Property ($ this ->blocks [$ i ]);
111+ $ tempProperty = new Property ($ this , $ this ->blocks [$ i ]);
95112
96113 if ($ tempProperty ->corrupted === false )
97114 {
0 commit comments