Skip to content

Commit

Permalink
Version 0.58.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronef committed Mar 29, 2023
2 parents 6f76311 + db94d9b commit 0f57e86
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# (MODX)EvolutionCMS.libraries.ddTools changelog


## Version 0.58.1 (2023-03-29)
* \* `\DDTools\ObjectTools::convertType` → Parameters → `$params->type` → Valid values → `'stringQueryFormatted'`: A mistake has been fixed. The incorrect value `'stringQueryFormated'` is also supported for backward compatibility.


## Version 0.58 (2023-03-21)
* \+ `\DDTools\Base\AncestorTrait::createChildInstance` → Parameters → `$params->parentDir`: Is no longer required and by default is equal to dirname of a class that uses this trait.

Expand Down Expand Up @@ -61,7 +65,7 @@


## Version 0.51 (2021-11-08)
* \+ `\DDTools\ObjectTools::convertType`: Added the ability to return `stringQueryFormated`.
* \+ `\DDTools\ObjectTools::convertType`: Added the ability to return `stringQueryFormatted`.


## Version 0.50 (2021-05-11)
Expand All @@ -71,7 +75,7 @@
* \+ `$meta['success']`: Is not required anymore and by default will be equal to `true`.
* \+ `$meta['code']`: Is not required anymore and by default will be equal to `200` or `400` depending on `$meta['success']`.
* \+ `$meta`:
* \+ Can also be set as stdClass, stringJsonObject, stringHjsonObject, stringQueryFormated.
* \+ Can also be set as stdClass, stringJsonObject, stringHjsonObject, stringQueryFormatted.
* \+ Is not required anymore and by default will be equal to `['success' => true, 'code' => 200]`.
* \+ `setMetaMessage`: If `$this->meta` is not set, it will be set with default values of `success` and `code`.

Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG_ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# (MODX)EvolutionCMS.libraries.ddTools changelog


## Версия 0.58.1 (2023-03-29)
* \* `\DDTools\ObjectTools::convertType` → Параметры → `$params->type` → Допустимые значения → `'stringQueryFormatted'`: Исправлена ошибка в написании. Некорректное значение `'stringQueryFormated'` также поддерживается для обратной совместимости.


## Версия 0.58 (2023-03-21)
* \+ `\DDTools\Base\AncestorTrait::createChildInstance` → Параметры → `$params->parentDir`: Больше не обязателен и по умолчанию равен папке класса, использующего этот трейт.

Expand Down Expand Up @@ -61,7 +65,7 @@


## Версия 0.51 (2021-11-08)
* \+ `\DDTools\ObjectTools::convertType`: Добавлена возможность конвертировать в `stringQueryFormated`.
* \+ `\DDTools\ObjectTools::convertType`: Добавлена возможность конвертировать в `stringQueryFormatted`.


## Версия 0.50 (2021-05-11)
Expand All @@ -71,7 +75,7 @@
* \+ `$meta['success']`: Больше не обязателен и по умолчанию будет равен `true`.
* \+ `$meta['code']`: Больше не обязателен и по умолчанию будет равен `200` или `400` в зависимости от `$meta['success']`.
* \+ `$meta`:
* \+ Также может быть задан как stdClass, stringJsonObject, stringHjsonObject, stringQueryFormated.
* \+ Также может быть задан как stdClass, stringJsonObject, stringHjsonObject, stringQueryFormatted.
* \+ Больше не обязателен и по умолчанию будет равен `['success' => true, 'code' => 200]`.
* \+ `setMetaMessage`: Если `$this->meta` не задано, будет задано со значениями по умолчанию `success` и `code`.

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,7 @@ array(
* [Home page](https://code.divandesign.biz/modx/ddtools)
* [Telegram chat](https://t.me/dd_code)
* [Packagist](https://packagist.org/packages/dd/evolutioncms-libraries-ddtools)
* [GitHub](https://github.com/DivanDesign/EvolutionCMS.libraries.ddTools)


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dd/evolutioncms-libraries-ddtools",
"type": "modxevo-library-ddtools",
"version": "0.58.0",
"version": "0.58.1",
"description": "A library with various tools facilitating your work.",
"keywords": [
"modx",
Expand Down
4 changes: 2 additions & 2 deletions modx.ddtools.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* EvolutionCMS.libraries.ddTools
* @version 0.58 (2023-03-21)
* @version 0.58.1 (2023-03-29)
*
* @see README.md
*
Expand Down Expand Up @@ -690,7 +690,7 @@ public static function escapeForJS($str){
* 1. [JSON](https://en.wikipedia.org/wiki/JSON).
* 2. [Query string](https://en.wikipedia.org/wiki/Query_string).
*
* @param $inputString {stringJsonObject|stringJsonArray|stringQueryFormated|stdClass|array} — Input string. @required
* @param $inputString {stringJsonObject|stringJsonArray|stringQueryFormatted|stdClass|array} — Input string. @required
*
* @return {array}
*/
Expand Down
10 changes: 7 additions & 3 deletions src/ObjectTools/ObjectTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static function getPropValue($params){

/**
* convertType
* @version 1.2 (2021-11-08)
* @version 1.2.1 (2023-03-29)
*
* @see README.md
*/
Expand Down Expand Up @@ -222,8 +222,12 @@ public static function convertType($params){
//array
}elseif ($params->type == 'objectarray'){
$result = (array) $result;
//stringQueryFormated
}elseif ($params->type == 'stringqueryformated'){
//stringQueryFormatted
}elseif (
$params->type == 'stringqueryformatted' ||
//Backward compatibility with typo
$params->type == 'stringqueryformated'
){
$result = http_build_query($result);
//stringJson
}elseif(
Expand Down
8 changes: 4 additions & 4 deletions src/Response/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function validateMetaMessage($message){

/**
* setMeta
* @version 1.4 (2021-05-11)
* @version 1.4.1 (2023-03-29)
*
* @desc Setter for $this->meta.
*
Expand All @@ -152,7 +152,7 @@ public function validateMetaMessage($message){
* @return {boolean}
*/
public function setMeta($meta = []){
//If $meta is set as stdClass, stringJsonObject, stringHjsonObject or stringQueryFormated
//If $meta is set as stdClass, stringJsonObject, stringHjsonObject or stringQueryFormatted
if (!is_array($meta)){
$meta = \DDTools\ObjectTools::convertType([
'object' => $meta,
Expand Down Expand Up @@ -238,7 +238,7 @@ public function setData($data){

/**
* setMetaData
* @version 1.0 (2021-05-11)
* @version 1.0.1 (2023-03-29)
*
* @desc Setter for $this->meta and $this->data.
*
Expand All @@ -247,7 +247,7 @@ public function setData($data){
* @return {void}
*/
public function setMetaData($params){
//If $meta is set as stdClass, stringJsonObject, stringHjsonObject or stringQueryFormated
//If $meta is set as stdClass, stringJsonObject, stringHjsonObject or stringQueryFormatted
if (!is_array($params)){
$params = \DDTools\ObjectTools::convertType([
'object' => $params,
Expand Down

0 comments on commit 0f57e86

Please sign in to comment.