2424namespace WSDL \Parser ;
2525
2626use Ouzo \Utilities \Arrays ;
27+ use Ouzo \Utilities \Functions ;
2728use WSDL \Types \Type ;
2829
2930/**
3334 */
3435class MethodParser
3536{
36- private $ _name ;
37- private $ _doc ;
38- private $ _rawParameters ;
39- private $ _rawReturn ;
37+ /**
38+ * @var string
39+ */
40+ private $ name ;
41+ /**
42+ * @var string
43+ */
44+ private $ doc ;
45+ /**
46+ * @var array
47+ */
48+ private $ rawParameters ;
49+ /**
50+ * @var string
51+ */
52+ private $ rawReturn ;
4053
4154 public function __construct ($ name , $ doc )
4255 {
43- $ this ->_name = $ name ;
44- $ this ->_doc = $ doc ;
56+ $ this ->name = $ name ;
57+ $ this ->doc = $ doc ;
4558 }
4659
60+ /**
61+ * @return string
62+ */
4763 public function description ()
4864 {
49- preg_match ('#@desc (.+)# ' , $ this ->_doc , $ groupMatches );
50- $ trimGroupMatches = array_map ( ' trim ' , $ groupMatches );
65+ preg_match ('#@desc (.+)# ' , $ this ->doc , $ groupMatches );
66+ $ trimGroupMatches = Arrays:: map ( $ groupMatches, Functions:: trim () );
5167 return Arrays::getValue ($ trimGroupMatches , 1 , '' );
5268 }
5369
@@ -56,41 +72,56 @@ public function description()
5672 */
5773 public function parameters ()
5874 {
59- preg_match_all ('#@param (.+)# ' , $ this ->_doc , $ groupMatches );
60- $ this ->_rawParameters = $ groupMatches [1 ];
75+ preg_match_all ('#@param (.+)# ' , $ this ->doc , $ groupMatches );
76+ $ this ->rawParameters = $ groupMatches [1 ];
6177 return ParameterParser::create ($ groupMatches [1 ], $ this ->getName ());
6278 }
6379
80+ /**
81+ * @return Type
82+ */
6483 public function returning ()
6584 {
66- preg_match ('#@return (.+)# ' , $ this ->_doc , $ groupMatches );
85+ preg_match ('#@return (.+)# ' , $ this ->doc , $ groupMatches );
6786 $ trimGroupMatches = array_map ('trim ' , $ groupMatches );
6887 if (isset ($ trimGroupMatches [1 ])) {
69- $ this ->_rawReturn = $ trimGroupMatches [1 ];
88+ $ this ->rawReturn = $ trimGroupMatches [1 ];
7089 }
71- $ parameterParser = new ParameterParser ($ this ->_rawReturn , $ this ->getName ());
90+ $ parameterParser = new ParameterParser ($ this ->rawReturn , $ this ->getName ());
7291 return $ parameterParser ->parse ();
7392 }
7493
94+ /**
95+ * @return string
96+ */
7597 public function getDoc ()
7698 {
77- return $ this ->_doc ;
99+ return $ this ->doc ;
78100 }
79101
102+ /**
103+ * @return string
104+ */
80105 public function getName ()
81106 {
82- return $ this ->_name ;
107+ return $ this ->name ;
83108 }
84109
110+ /**
111+ * @return array
112+ */
85113 public function getRawParameters ()
86114 {
87115 $ this ->parameters ();
88- return $ this ->_rawParameters ;
116+ return $ this ->rawParameters ;
89117 }
90118
119+ /**
120+ * @return string
121+ */
91122 public function getRawReturn ()
92123 {
93124 $ this ->returning ();
94- return $ this ->_rawReturn ;
125+ return $ this ->rawReturn ;
95126 }
96127}
0 commit comments