@@ -101,7 +101,7 @@ class REST extends Module implements DependsOnModule, PartedModule, API, Conflic
101101 /**
102102 * @var array<string, string>
103103 */
104- protected $ config = [
104+ protected array $ config = [
105105 'url ' => '' ,
106106 'aws ' => ''
107107 ];
@@ -245,7 +245,6 @@ public function deleteHeader(string $name): void
245245 * Checks over the given HTTP header and (optionally)
246246 * its value, asserting that are there
247247 *
248- * @param string $name
249248 * @param $value
250249 * @part json
251250 * @part xml
@@ -267,7 +266,6 @@ public function seeHttpHeader(string $name, $value = null): void
267266 * Checks over the given HTTP header and (optionally)
268267 * its value, asserting that are not there
269268 *
270- * @param string $name
271269 * @param $value
272270 * @part json
273271 * @part xml
@@ -295,7 +293,6 @@ public function dontSeeHttpHeader(string $name, $value = null): void
295293 * $I->seeHttpHeaderOnce('Cache-Control');
296294 * ```
297295 *
298- * @param string $name
299296 * @part json
300297 * @part xml
301298 */
@@ -313,7 +310,7 @@ public function seeHttpHeaderOnce(string $name): void
313310 * @part json
314311 * @part xml
315312 */
316- public function grabHttpHeader (string $ name , bool $ first = true )
313+ public function grabHttpHeader (string $ name , bool $ first = true ): string | array
317314 {
318315 return $ this ->getRunningClient ()->getInternalResponse ()->getHeader ($ name , $ first );
319316 }
@@ -408,7 +405,6 @@ public function amNTLMAuthenticated(string $username, string $password): void
408405 * <?php
409406 * $I->amAWSAuthenticated();
410407 * ```
411- * @param array $additionalAWSConfig
412408 * @throws ConfigurationException
413409 */
414410 public function amAWSAuthenticated (array $ additionalAWSConfig = []): void
@@ -528,7 +524,7 @@ public function sendGet(string $url, array $params = [])
528524 * $response = $I->sendPut('/message/1', ['subject' => 'Read this!']);
529525 * ```
530526 *
531- * @param array|string|\ JsonSerializable $params
527+ * @param array|string|JsonSerializable $params
532528 * @part json
533529 * @part xml
534530 */
@@ -545,7 +541,7 @@ public function sendPut(string $url, $params = [], array $files = [])
545541 * $response = $I->sendPatch('/message/1', ['subject' => 'Read this!']);
546542 * ```
547543 *
548- * @param array|string|\ JsonSerializable $params
544+ * @param array|string|JsonSerializable $params
549545 * @part json
550546 * @part xml
551547 */
@@ -657,7 +653,7 @@ protected function execute($method, $url, $parameters = [], $files = [])
657653 $ url = $ this ->config ['url ' ];
658654 } elseif (!is_string ($ url )) {
659655 throw new ModuleException (__CLASS__ , 'URL must be string ' );
660- } elseif (strpos ($ url , ':// ' ) === false && $ this ->config ['url ' ]) {
656+ } elseif (! str_contains ($ url , ':// ' ) && $ this ->config ['url ' ]) {
661657 $ url = rtrim ($ this ->config ['url ' ], '/ ' ) . '/ ' . ltrim ($ url , '/ ' );
662658 }
663659
@@ -676,7 +672,7 @@ protected function execute($method, $url, $parameters = [], $files = [])
676672 if (is_array ($ parameters ) || $ isQueryParamsAwareMethod ) {
677673 if ($ isQueryParamsAwareMethod ) {
678674 if (!empty ($ parameters )) {
679- if (strpos ($ url , '? ' ) !== false ) {
675+ if (str_contains ($ url , '? ' )) {
680676 $ url .= '& ' ;
681677 } else {
682678 $ url .= '? ' ;
@@ -706,7 +702,7 @@ protected function execute($method, $url, $parameters = [], $files = [])
706702 }
707703
708704 $ printedResponse = $ this ->response ;
709- if ($ this ->isBinaryData ((string ) $ printedResponse )) {
705+ if ($ this ->isBinaryData ((string )$ printedResponse )) {
710706 $ printedResponse = $ this ->binaryToDebugString ($ printedResponse );
711707 }
712708
@@ -980,7 +976,6 @@ public function seeResponseIsValidOnJsonSchemaString(string $schema): void
980976 * Checks whether last response matches the supplied json schema (https://json-schema.org/)
981977 * Supply schema as relative file path in your project directory or an absolute path
982978 *
983- * @param string $schemaFilename
984979 * @part json
985980 * @see codecept_absolute_path()
986981 */
@@ -1000,7 +995,7 @@ public function seeResponseIsValidOnJsonSchema(string $schemaFilename): void
1000995 * @param string $jsonString the json encoded string
1001996 * @param string $errorFormat optional string for custom sprintf format
1002997 */
1003- protected function decodeAndValidateJson (string $ jsonString , string $ errorFormat= "Invalid json: %s. System message: %s. " )
998+ protected function decodeAndValidateJson (string $ jsonString , string $ errorFormat = "Invalid json: %s. System message: %s. " )
1004999 {
10051000 $ json = json_decode ($ jsonString );
10061001 $ errorCode = json_last_error ();
0 commit comments