@@ -9,17 +9,16 @@ public function __construct(){
99 $ this ->loadBasicServices ();
1010 $ this ->loadParser ();
1111 $ this ->map ['Composer ' ] = new \Utils \Composer ($ this ->get ("Path " ));
12- $ this ->map [' ClassUtils ' ] = new \Utils \ClassUtils (
12+ $ this ->map [" ClassUtils " ] = new \Utils \ClassUtils (
1313 $ this ->get ("Path " ),
14- $ this ->get ("ClassParser " )
14+ $ this ->get ("Parser " )
1515 );
1616 $ this ->map ["IndexGenerator " ] = new \IndexGenerator (
1717 $ this ->get ("Path " ),
1818 $ this ->get ("Composer " ),
1919 $ this ->get ("ClassUtils " )
2020 );
2121 $ this ->map ["IndexWriter " ] = new \Utils \IndexWriter (
22- $ this ->get ("IndexGenerator " ),
2322 $ this ->get ("Path " )
2423 );
2524 }
@@ -28,7 +27,7 @@ public function get($service){
2827 return $ this ->map [$ service ];
2928 }
3029 else {
31- throw new \ Exception ("Unknown service \"{$ service }\"" );
30+ throw new ServiceNotFoundException ("Unknown service \"{$ service }\"" );
3231 }
3332 }
3433 public function set ($ serviceName , $ service , $ overwrite = false ){
@@ -42,7 +41,7 @@ public function set($serviceName, $service, $overwrite = false){
4241 }
4342 private function loadBasicServices (){
4443 $ this ->map = [
45- 'Index ' => new \DTO \Index (),
44+ 'Index ' => new \Entity \Index (),
4645 'PathUtils ' => new \Phine \Path \Path (),
4746 'PhpParser ' => new \PhpParser \Parser (new \PhpParser \Lexer ),
4847 'Traverser ' => new \PhpParser \NodeTraverser (),
@@ -51,11 +50,36 @@ private function loadBasicServices(){
5150 $ this ->map ['Path ' ] = new \Utils \PathResolver ($ this ->get ("PathUtils " ));
5251 }
5352 private function loadParser (){
54- $ this ->map ['ClassParser ' ] = new \Parser \ClassParser (
53+ $ this ->set ("UseParser " , new \Parser \UseParser );
54+ $ this ->set ("MethodParser " , new \Parser \MethodParser (
55+ $ this ->get ("UseParser " )
56+ ));
57+ $ this ->set ("PropertyParser " , new \Parser \PropertyParser (
58+ $ this ->get ("UseParser " )
59+ ));
60+ $ this ->set ("CommentParser " , new \Parser \CommentParser (
61+ $ this ->get ("UseParser " )
62+ ));
63+ $ this ->map ["ClassParser " ] = new \Parser \ClassParser (
64+ $ this ->get ("CommentParser " ),
65+ $ this ->get ("MethodParser " ),
66+ $ this ->get ("PropertyParser " ),
67+ $ this ->get ("UseParser " )
68+ );
69+ $ this ->map ["InterfaceParser " ] = new \Parser \InterfaceParser (
70+ $ this ->get ("CommentParser " ),
71+ $ this ->get ("MethodParser " ),
72+ $ this ->get ("PropertyParser " )
73+ );
74+
75+ $ this ->map ['Parser ' ] = new \Parser \Parser (
5576 $ this ->get ("PhpParser " ),
77+ $ this ->get ("ClassParser " ),
78+ $ this ->get ("InterfaceParser " ),
79+ $ this ->get ("UseParser " ),
5680 $ this ->get ("Path " )
5781 );
58- $ this ->map ['ClassParser ' ]->setTraverser ($ this ->get ('Traverser ' ));
59- $ this ->map ['ClassParser ' ]->setVisitor ($ this ->get ('Visitor ' ));
82+ $ this ->map ['Parser ' ]->setTraverser ($ this ->get ('Traverser ' ));
83+ $ this ->map ['Parser ' ]->setVisitor ($ this ->get ('Visitor ' ));
6084 }
6185}
0 commit comments