@@ -65,24 +65,10 @@ protected function assertString($value, $what = '', $allowNumeric = false, $allo
6565 throw new InvalidArgumentException (\sprintf (
6666 '%s must be a string, %s provided. ' ,
6767 \ucfirst ($ what ),
68- $ this -> getDebugType ($ value )
68+ \ bdk \ HttpMessage \ Utility \ParseStr:: getDebugType ($ value )
6969 ));
7070 }
7171
72- /**
73- * Gets the type name of a variable in a way that is suitable for debugging
74- *
75- * @param mixed $value Value to inspect
76- *
77- * @return string
78- */
79- protected static function getDebugType ($ value )
80- {
81- return \is_object ($ value )
82- ? \get_class ($ value )
83- : \strtolower (\gettype ($ value ));
84- }
85-
8672 /*
8773 Message assertions
8874 */
@@ -135,7 +121,7 @@ private function assertHeaderValue($value)
135121 if (\is_array ($ value ) === false ) {
136122 throw new InvalidArgumentException (\sprintf (
137123 'The header field value only accepts string and array, %s provided. ' ,
138- self ::getDebugType ($ value )
124+ \ bdk \ HttpMessage \ Utility \ParseStr ::getDebugType ($ value )
139125 ));
140126 }
141127 if (empty ($ value )) {
@@ -212,7 +198,7 @@ private function assertProtocolVersion($version)
212198 if (\is_numeric ($ version ) === false ) {
213199 throw new InvalidArgumentException (\sprintf (
214200 'Unsupported HTTP protocol version number. %s provided. ' ,
215- self ::getDebugType ($ version )
201+ \ bdk \ HttpMessage \ Utility \ParseStr ::getDebugType ($ version )
216202 ));
217203 }
218204 if (\in_array ((string ) $ version , $ this ->validProtocolVers , true ) === false ) {
@@ -333,7 +319,7 @@ protected function assertQueryParams(array $get)
333319 throw new InvalidArgumentException (\sprintf (
334320 'Query params must only contain scalar values, %s contains %s. ' ,
335321 $ this ->iteratorPath ($ iterator ),
336- $ this -> getDebugType ($ value )
322+ \ bdk \ HttpMessage \ Utility \ParseStr:: getDebugType ($ value )
337323 ));
338324 }
339325 }
@@ -359,7 +345,7 @@ protected function assertParsedBody($data)
359345 }
360346 throw new InvalidArgumentException (\sprintf (
361347 'ParsedBody must be array, object, or null. %s provided. ' ,
362- self ::getDebugType ($ data )
348+ \ bdk \ HttpMessage \ Utility \ParseStr ::getDebugType ($ data )
363349 ));
364350 }
365351
@@ -378,7 +364,7 @@ protected function assertUploadedFiles(array $uploadedFiles)
378364 if (!($ val instanceof UploadedFileInterface)) {
379365 throw new InvalidArgumentException (\sprintf (
380366 'Invalid file in uploaded files structure. Expected UploadedFileInterface, %s provided ' ,
381- self ::getDebugType ($ val )
367+ \ bdk \ HttpMessage \ Utility \ParseStr ::getDebugType ($ val )
382368 ));
383369 }
384370 });
@@ -435,7 +421,7 @@ protected function assertStatusCode($code)
435421 if (\is_int ($ code ) === false ) {
436422 throw new InvalidArgumentException (\sprintf (
437423 'Status code must to be an integer, %s provided. ' ,
438- self ::getDebugType ($ code )
424+ \ bdk \ HttpMessage \ Utility \ParseStr ::getDebugType ($ code )
439425 ));
440426 }
441427 if ($ code < 100 || $ code > 599 ) {
0 commit comments