@@ -53,20 +53,20 @@ class HTTPRequest implements Comparable
53
53
public $ parent ;
54
54
55
55
/**
56
- * Body of the request (if POST or PUT) .
56
+ * Body of the request.
57
57
*
58
58
* @var mixed
59
59
*/
60
- public $ body = null ;
60
+ public $ body = NULL ;
61
61
62
62
/**
63
- * Schema of the body of the request (if POST or PUT) .
63
+ * Schema of the body of the request.
64
64
*
65
65
* @var mixed
66
66
*/
67
- public $ body_schema = null ;
67
+ public $ body_schema = NULL ;
68
68
/**
69
- * Structure of the request (if POST or PUT) .
69
+ * Structure of the request.
70
70
*
71
71
* @var RequestBodyElement
72
72
*/
@@ -99,9 +99,9 @@ public function __construct(Transition &$parent)
99
99
public function parse (stdClass $ object ): self
100
100
{
101
101
$ 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 ;
103
103
104
- if (( $ this -> method === ' POST ' || $ this -> method === ' PUT ' ) && !empty ($ object ->content )) {
104
+ if (!empty ($ object ->content )) {
105
105
foreach ($ object ->content as $ value ) {
106
106
if ($ value ->element === 'dataStructure ' ) {
107
107
$ this ->parse_structure ($ value );
@@ -117,20 +117,20 @@ public function parse(stdClass $object): self
117
117
continue ;
118
118
}
119
119
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 ;
121
121
$ this ->headers ['Content-Type ' ] = (isset ($ value ->attributes ->contentType )) ? $ value ->attributes ->contentType : '' ;
122
122
continue ;
123
123
}
124
124
125
125
if (isset ($ value ->meta ->classes ->content )
126
126
&& is_array ($ value ->meta ->classes ->content )
127
127
&& $ 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 ;
129
129
$ this ->headers ['Content-Type ' ] = (isset ($ value ->attributes ->contentType ->content )) ? $ value ->attributes ->contentType ->content : '' ;
130
130
} elseif (isset ($ value ->meta ->classes ->content )
131
131
&& is_array ($ value ->meta ->classes ->content )
132
132
&& $ 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 ;
134
134
}
135
135
}
136
136
}
@@ -141,7 +141,7 @@ public function parse(stdClass $object): self
141
141
}
142
142
}
143
143
144
- if ($ this ->body === null ) {
144
+ if ($ this ->body === NULL ) {
145
145
$ this ->body = &$ this ->struct ;
146
146
}
147
147
@@ -174,15 +174,15 @@ public function get_id(): string
174
174
* @param string $base_url URL to the base server
175
175
* @param array $additional Extra options to pass to cURL
176
176
*
177
- * @return string An executable cURL command
178
177
* @throws Exception
179
178
*
179
+ * @return string An executable cURL command
180
180
*/
181
181
public function get_curl_command (string $ base_url , array $ additional = []): string
182
182
{
183
183
$ options = [];
184
184
185
- $ type = $ this ->headers ['Content-Type ' ] ?? null ;
185
+ $ type = $ this ->headers ['Content-Type ' ] ?? NULL ;
186
186
187
187
$ options [] = '-X ' . $ this ->method ;
188
188
if (empty ($ this ->body )) {
@@ -205,7 +205,7 @@ public function get_curl_command(string $base_url, array $additional = []): stri
205
205
$ options = array_merge ($ options , $ additional );
206
206
207
207
return htmlspecialchars ('curl ' . join (' ' , $ options ) . ' ' . escapeshellarg ($ this ->parent ->build_url ($ base_url ,
208
- true )));
208
+ TRUE )));
209
209
}
210
210
211
211
/**
@@ -226,17 +226,17 @@ public function is_equal_to($b): bool
226
226
* @param string $base_url URL to the base server
227
227
* @param array $additional Extra options to pass to the service
228
228
*
229
- * @return string
230
229
* @throws Exception
231
230
*
231
+ * @return string
232
232
*/
233
233
public function get_hurl_link (string $ base_url , array $ additional = []): string
234
234
{
235
235
$ options = [];
236
236
237
- $ type = (isset ($ this ->headers ['Content-Type ' ])) ? $ this ->headers ['Content-Type ' ] : null ;
237
+ $ type = (isset ($ this ->headers ['Content-Type ' ])) ? $ this ->headers ['Content-Type ' ] : NULL ;
238
238
239
- $ url = $ this ->parent ->build_url ($ base_url , true );
239
+ $ url = $ this ->parent ->build_url ($ base_url , TRUE );
240
240
$ url = explode ('? ' , $ url );
241
241
if (isset ($ url [1 ])) {
242
242
$ params = [];
0 commit comments