@@ -37,7 +37,7 @@ private function anonymous($tree, $start, $end) {
3737 }
3838
3939 /** Returns the syntax tree for a given type using a cache */
40- private function treeOf ($ class , $ file ) {
40+ private function tree ($ class , $ file ) {
4141 if (null === ($ tree = $ this ->cache [$ file ] ?? null )) {
4242 $ this ->cache [$ file ]= $ tree = self ::$ lang ->parse (new Tokens (file_get_contents ($ file ), $ file ))->tree ();
4343 if (sizeof ($ this ->cache ) > self ::CACHE_SIZE ) unset($ this ->cache [key ($ this ->cache )]);
@@ -147,7 +147,7 @@ private function parse($code, $resolver) {
147147 }
148148
149149 public function evaluate ($ arg , $ code ) {
150- $ tree = $ arg instanceof SyntaxTree ? $ arg : $ this ->treeOf ($ arg , $ arg ->getFileName ());
150+ $ tree = $ arg instanceof SyntaxTree ? $ arg : $ this ->tree ($ arg , $ arg ->getFileName ());
151151 $ parsed = self ::parse ($ code , $ tree ->resolver ())->tree ()->children ();
152152 if (1 === sizeof ($ parsed )) {
153153 return $ parsed [0 ]->visit ($ tree );
@@ -190,7 +190,7 @@ private function annotations($tree, $annotated) {
190190 }
191191
192192 public function imports ($ reflect ) {
193- $ resolver = $ this ->treeOf ($ reflect , $ reflect ->getFileName ())->resolver ();
193+ $ resolver = $ this ->tree ($ reflect , $ reflect ->getFileName ())->resolver ();
194194 $ imports = [];
195195 foreach ($ resolver ->imports as $ alias => $ type ) {
196196 $ imports [$ alias ]= ltrim ($ type , '\\' );
@@ -200,34 +200,34 @@ public function imports($reflect) {
200200
201201 /** @return iterable */
202202 public function ofType ($ reflect ) {
203- $ tree = $ this ->treeOf ($ reflect , $ reflect ->getFileName ());
203+ $ tree = $ this ->tree ($ reflect , $ reflect ->getFileName ());
204204 return $ this ->annotations ($ tree , $ tree ->type ());
205205 }
206206
207207 /** @return iterable */
208208 public function ofConstant ($ reflect ) {
209209 $ class = $ reflect ->getDeclaringClass ();
210- $ tree = $ this ->treeOf ($ class , $ class ->getFileName ());
210+ $ tree = $ this ->tree ($ class , $ class ->getFileName ());
211211 return $ this ->annotations ($ tree , $ tree ->type ()->constant ($ reflect ->name ));
212212 }
213213
214214 /** @return iterable */
215215 public function ofProperty ($ reflect ) {
216216 $ class = $ reflect ->getDeclaringClass ();
217- $ tree = $ this ->treeOf ($ class , $ class ->getFileName ());
217+ $ tree = $ this ->tree ($ class , $ class ->getFileName ());
218218 return $ this ->annotations ($ tree , $ tree ->type ()->property ($ reflect ->name ));
219219 }
220220
221221 /** @return iterable */
222222 public function ofMethod ($ reflect ) {
223- $ tree = $ this ->treeOf ($ reflect ->getDeclaringClass (), $ reflect ->getFileName ());
223+ $ tree = $ this ->tree ($ reflect ->getDeclaringClass (), $ reflect ->getFileName ());
224224 return $ this ->annotations ($ tree , $ tree ->type ()->method ($ reflect ->name ));
225225 }
226226
227227 /** @return iterable */
228228 public function ofParameter ($ method , $ reflect ) {
229229 $ class = $ reflect ->getDeclaringClass ();
230- $ tree = $ this ->treeOf ($ class , $ class ->getMethod ($ method ->name )->getFileName ());
230+ $ tree = $ this ->tree ($ class , $ class ->getMethod ($ method ->name )->getFileName ());
231231 return $ this ->annotations ($ tree , $ tree ->type ()
232232 ->method ($ method ->name )
233233 ->signature
0 commit comments