@@ -53,20 +53,20 @@ class HTTPRequest implements Comparable
5353 public $ parent ;
5454
5555 /**
56- * Body of the request (if POST or PUT) .
56+ * Body of the request.
5757 *
5858 * @var mixed
5959 */
60- public $ body = null ;
60+ public $ body = NULL ;
6161
6262 /**
63- * Schema of the body of the request (if POST or PUT) .
63+ * Schema of the body of the request.
6464 *
6565 * @var mixed
6666 */
67- public $ body_schema = null ;
67+ public $ body_schema = NULL ;
6868 /**
69- * Structure of the request (if POST or PUT) .
69+ * Structure of the request.
7070 *
7171 * @var RequestBodyElement
7272 */
@@ -99,9 +99,9 @@ public function __construct(Transition &$parent)
9999 public function parse (stdClass $ object ): self
100100 {
101101 $ this ->method = $ object ->attributes ->method ->content ?? $ object ->attributes ->method ;
102- $ this ->title = isset ($ object ->meta ->title ) ? $ object ->meta ->title : null ;
102+ $ this ->title = isset ($ object ->meta ->title ) ? $ object ->meta ->title : NULL ;
103103
104- if (( $ this -> method === ' POST ' || $ this -> method === ' PUT ' ) && !empty ($ object ->content )) {
104+ if (!empty ($ object ->content )) {
105105 foreach ($ object ->content as $ value ) {
106106 if ($ value ->element === 'dataStructure ' ) {
107107 $ this ->parse_structure ($ value );
@@ -117,20 +117,20 @@ public function parse(stdClass $object): self
117117 continue ;
118118 }
119119 if (is_array ($ value ->meta ->classes ) && in_array ('messageBody ' , $ value ->meta ->classes )) {
120- $ this ->body [] = (isset ($ value ->content )) ? $ value ->content : null ;
120+ $ this ->body [] = (isset ($ value ->content )) ? $ value ->content : NULL ;
121121 $ this ->headers ['Content-Type ' ] = (isset ($ value ->attributes ->contentType )) ? $ value ->attributes ->contentType : '' ;
122122 continue ;
123123 }
124124
125125 if (isset ($ value ->meta ->classes ->content )
126126 && is_array ($ value ->meta ->classes ->content )
127127 && $ value ->meta ->classes ->content [0 ]->content === 'messageBody ' ) {
128- $ this ->body [] = (isset ($ value ->content )) ? $ value ->content : null ;
128+ $ this ->body [] = (isset ($ value ->content )) ? $ value ->content : NULL ;
129129 $ this ->headers ['Content-Type ' ] = (isset ($ value ->attributes ->contentType ->content )) ? $ value ->attributes ->contentType ->content : '' ;
130130 } elseif (isset ($ value ->meta ->classes ->content )
131131 && is_array ($ value ->meta ->classes ->content )
132132 && $ value ->meta ->classes ->content [0 ]->content === 'messageBodySchema ' ) {
133- $ this ->body_schema = (isset ($ value ->content )) ? $ value ->content : null ;
133+ $ this ->body_schema = (isset ($ value ->content )) ? $ value ->content : NULL ;
134134 }
135135 }
136136 }
@@ -141,7 +141,7 @@ public function parse(stdClass $object): self
141141 }
142142 }
143143
144- if ($ this ->body === null ) {
144+ if ($ this ->body === NULL ) {
145145 $ this ->body = &$ this ->struct ;
146146 }
147147
@@ -174,15 +174,15 @@ public function get_id(): string
174174 * @param string $base_url URL to the base server
175175 * @param array $additional Extra options to pass to cURL
176176 *
177- * @return string An executable cURL command
178177 * @throws Exception
179178 *
179+ * @return string An executable cURL command
180180 */
181181 public function get_curl_command (string $ base_url , array $ additional = []): string
182182 {
183183 $ options = [];
184184
185- $ type = $ this ->headers ['Content-Type ' ] ?? null ;
185+ $ type = $ this ->headers ['Content-Type ' ] ?? NULL ;
186186
187187 $ options [] = '-X ' . $ this ->method ;
188188 if (empty ($ this ->body )) {
@@ -205,7 +205,7 @@ public function get_curl_command(string $base_url, array $additional = []): stri
205205 $ options = array_merge ($ options , $ additional );
206206
207207 return htmlspecialchars ('curl ' . join (' ' , $ options ) . ' ' . escapeshellarg ($ this ->parent ->build_url ($ base_url ,
208- true )));
208+ TRUE )));
209209 }
210210
211211 /**
@@ -226,17 +226,17 @@ public function is_equal_to($b): bool
226226 * @param string $base_url URL to the base server
227227 * @param array $additional Extra options to pass to the service
228228 *
229- * @return string
230229 * @throws Exception
231230 *
231+ * @return string
232232 */
233233 public function get_hurl_link (string $ base_url , array $ additional = []): string
234234 {
235235 $ options = [];
236236
237- $ type = (isset ($ this ->headers ['Content-Type ' ])) ? $ this ->headers ['Content-Type ' ] : null ;
237+ $ type = (isset ($ this ->headers ['Content-Type ' ])) ? $ this ->headers ['Content-Type ' ] : NULL ;
238238
239- $ url = $ this ->parent ->build_url ($ base_url , true );
239+ $ url = $ this ->parent ->build_url ($ base_url , TRUE );
240240 $ url = explode ('? ' , $ url );
241241 if (isset ($ url [1 ])) {
242242 $ params = [];
0 commit comments