Skip to content

Commit

Permalink
+ \DDTools\ObjectTools::convertType: Added the ability to return `s…
Browse files Browse the repository at this point in the history
…tringQueryFormated`.
  • Loading branch information
Ronef committed Nov 8, 2021
1 parent f8db333 commit 29ff9fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ Arrays, [JSON](https://en.wikipedia.org/wiki/JSON) and [Query string](https://en
* `stringJsonArray` — [JSON](https://en.wikipedia.org/wiki/JSON) array
* `stringHjsonObject` — [HJSON](https://hjson.github.io/) object
* `stringHjsonArray` — [HJSON](https://hjson.github.io/) array
* `stringQueryFormated`
* `stringQueryFormated` — [Query string](https://en.wikipedia.org/wiki/Query_string)
* **Required**

* `$params->type`
Expand All @@ -343,6 +343,7 @@ Arrays, [JSON](https://en.wikipedia.org/wiki/JSON) and [Query string](https://en
* `'stringJsonAuto'` — `stringJsonObject` or `stringJsonArray` depends on input object
* `'stringJsonObject'`
* `'stringJsonArray'`
* `'stringQueryFormated'`
* Default value: `'objectAuto'`


Expand Down
5 changes: 4 additions & 1 deletion src/ObjectTools/ObjectTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function getPropValue($params){

/**
* convertType
* @version 1.1 (2021-03-20)
* @version 1.2 (2021-11-08)
*
* @see README.md
*/
Expand Down Expand Up @@ -166,6 +166,9 @@ public static function convertType($params){
//array
}elseif ($params->type == 'objectarray'){
$result = (array) $result;
//stringQueryFormated
}elseif ($params->type == 'stringqueryformated'){
$result = http_build_query($result);
//stringJson
}elseif(
substr(
Expand Down

0 comments on commit 29ff9fc

Please sign in to comment.