@@ -125,10 +125,10 @@ protected function readIndex($mod = false)
125125 *
126126 * @return string
127127 */
128- protected function getNamespace ($ line , $ arr )
128+ protected function getNamespace (Loader $ obj , $ line , $ arr )
129129 {
130130 // Get actually namespace
131- $ namespaceRegEx = '/((namespace)+\s*( ' . preg_quote ($ this ->splitInsatnce ( true )) . ');)/ ' ;
131+ $ namespaceRegEx = '/((namespace)+\s*( ' . preg_quote ($ this ->splitInstance ( $ obj , true )) . ');)/ ' ;
132132 if (preg_match_all ($ namespaceRegEx , $ line , $ arr )) {
133133 // Debug information
134134 $ this ->debugInfo [] = '<b>Namespace:</b> <span style="color:blue;"> ' . $ arr [0 ][0 ] . '</span> ' ;
@@ -146,10 +146,10 @@ protected function getNamespace($line, $arr)
146146 * @param array $arr
147147 * @param integer $lineNum
148148 */
149- protected function getClass ($ filepath , $ line , $ arr , $ lineNum )
149+ protected function getClass (Loader $ obj , $ filepath , $ line , $ arr , $ lineNum )
150150 {
151151 // Get actually class
152- $ classRegEx = '/((interface|abstract\s+class|class|trait)+\s+( ' . preg_quote ($ this ->splitInsatnce ( )) . ')(.*)\{?)/ ' ;
152+ $ classRegEx = '/((interface|abstract\s+class|class|trait)+\s+( ' . preg_quote ($ this ->splitInstance ( $ obj )) . ')(.*)\{?)/ ' ;
153153
154154 if (preg_match_all ($ classRegEx , trim ($ line ), $ arr )) {
155155
@@ -167,7 +167,7 @@ protected function getClass($filepath, $line, $arr, $lineNum)
167167 // $this->loadIndex($class, $filepath);
168168
169169 // Found true for break
170- $ this ->found = true ;
170+ $ obj ->found = true ;
171171
172172 // Debug information
173173 $ this ->debugInfo [] = '<b>NEEDED CLASS</b><br> ' ;
@@ -181,22 +181,22 @@ protected function getClass($filepath, $line, $arr, $lineNum)
181181 /**
182182 * This function split the namespace and class, you can get the only namespace or only classname
183183 *
184- * @uses splitInsatnce (false) For classname
185- * @uses splitInsatnce (true) For namespace
184+ * @uses splitInstance (false) For classname
185+ * @uses splitInstance (true) For namespace
186186 *
187187 * @param boolean $namespaceORclass
188188 *
189189 * @return string
190190 */
191- protected function splitInsatnce ( $ namespaceORclass = false )
191+ protected function splitInstance ( Loader $ obj , $ namespaceORclass = false )
192192 {
193- if ($ this ->instance ) {
194- $ this ->namespace = explode ('\\' , $ this ->instance );
195- $ getLastForName = count ($ this ->namespace ) - 1 ;
196- $ classname = $ this ->namespace [$ getLastForName ];
197- unset($ this ->namespace [$ getLastForName ]);
193+ if ($ obj ->instance ) {
194+ $ obj ->namespace = explode ('\\' , $ obj ->instance );
195+ $ getLastForName = count ($ obj ->namespace ) - 1 ;
196+ $ classname = $ obj ->namespace [$ getLastForName ];
197+ unset($ obj ->namespace [$ getLastForName ]);
198198 if ($ namespaceORclass == true ) {
199- $ return = implode ('\\' , $ this ->namespace );
199+ $ return = implode ('\\' , $ obj ->namespace );
200200 } else {
201201 $ return = $ classname ;
202202 }
0 commit comments