From e07f9b119833ac5305980b16a2bba3715d8f5757 Mon Sep 17 00:00:00 2001 From: "Kamshory, MT" Date: Mon, 4 Nov 2024 06:01:58 +0700 Subject: [PATCH] Enhance debugging and docblock --- src/Database/PicoDatabase.php | 7 +++++-- src/Database/PicoJoinMap.php | 7 +++++-- src/Database/PicoLimit.php | 8 ++++---- src/Database/PicoPage.php | 7 +++++-- src/Database/PicoPageData.php | 7 +++++-- src/Database/PicoPageable.php | 7 +++++-- src/Database/PicoPredicate.php | 5 ++++- src/Database/PicoSortable.php | 7 +++++-- src/Database/PicoSpecification.php | 7 +++++-- src/Database/PicoSpecificationFilter.php | 7 +++++-- src/Database/PicoTableInfo.php | 2 ++ 11 files changed, 50 insertions(+), 21 deletions(-) diff --git a/src/Database/PicoDatabase.php b/src/Database/PicoDatabase.php index dc769a62..47dd40bb 100644 --- a/src/Database/PicoDatabase.php +++ b/src/Database/PicoDatabase.php @@ -695,9 +695,12 @@ public function getDatabaseType() } /** - * Magic method to debug the object. + * Convert the object to a JSON string representation for debugging. * - * @return string Returns a JSON representation of the object's state. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoJoinMap.php b/src/Database/PicoJoinMap.php index fafc7230..236d4686 100644 --- a/src/Database/PicoJoinMap.php +++ b/src/Database/PicoJoinMap.php @@ -117,9 +117,12 @@ public function getJoinTableAlias() } /** - * Magic method to return a JSON representation of the object. + * Convert the object to a JSON string representation for debugging. * - * @return string JSON representation of the join map. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoLimit.php b/src/Database/PicoLimit.php index 5fd15f6f..cd233c2f 100644 --- a/src/Database/PicoLimit.php +++ b/src/Database/PicoLimit.php @@ -133,12 +133,12 @@ public function getPage() } /** - * Return a string representation of the object in JSON format. + * Convert the object to a JSON string representation for debugging. * - * This method provides a convenient way to view the current limit - * and offset settings as a JSON string. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. * - * @return string + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoPage.php b/src/Database/PicoPage.php index 0f165a5f..2dddb249 100644 --- a/src/Database/PicoPage.php +++ b/src/Database/PicoPage.php @@ -124,9 +124,12 @@ public function getLimit() } /** - * Returns a string representation of the object. + * Convert the object to a JSON string representation for debugging. * - * @return string JSON encoded representation of the current page and size. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoPageData.php b/src/Database/PicoPageData.php index c7fd1a8c..99202e99 100644 --- a/src/Database/PicoPageData.php +++ b/src/Database/PicoPageData.php @@ -311,9 +311,12 @@ public function getPageSize() } /** - * Magic method to represent the object as a JSON string. + * Convert the object to a JSON string representation for debugging. * - * @return string JSON representation of the object. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoPageable.php b/src/Database/PicoPageable.php index c0cd1dff..6103fec2 100644 --- a/src/Database/PicoPageable.php +++ b/src/Database/PicoPageable.php @@ -191,9 +191,12 @@ public function setOffsetLimit($offsetLimit) } /** - * Magic method to return a string representation of the object for debugging. + * Convert the object to a JSON string representation for debugging. * - * @return string JSON representation of the pageable state. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoPredicate.php b/src/Database/PicoPredicate.php index 147a1ed7..3d55458a 100644 --- a/src/Database/PicoPredicate.php +++ b/src/Database/PicoPredicate.php @@ -396,7 +396,10 @@ public static function functionAndValue($function, $value) } /** - * Convert the object to a JSON string representation. + * Convert the object to a JSON string representation for debugging. + * + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. * * @return string The JSON representation of the object. */ diff --git a/src/Database/PicoSortable.php b/src/Database/PicoSortable.php index 5adfec0f..9abfad6b 100644 --- a/src/Database/PicoSortable.php +++ b/src/Database/PicoSortable.php @@ -223,9 +223,12 @@ public static function getInstance() } /** - * Convert the object to a string representation for debugging purposes. + * Convert the object to a JSON string representation for debugging. * - * @return string The string representation of the sortable criteria. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoSpecification.php b/src/Database/PicoSpecification.php index d8710e54..46541bea 100644 --- a/src/Database/PicoSpecification.php +++ b/src/Database/PicoSpecification.php @@ -374,9 +374,12 @@ private function addPredicate($field, $value) } /** - * Magic method for debugging the object. + * Convert the object to a JSON string representation for debugging. * - * @return string A string representation of the current specifications. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoSpecificationFilter.php b/src/Database/PicoSpecificationFilter.php index e1789e00..002034f0 100644 --- a/src/Database/PicoSpecificationFilter.php +++ b/src/Database/PicoSpecificationFilter.php @@ -51,9 +51,12 @@ public function __construct($columnName, $dataType) } /** - * Magic method to return a JSON representation of the object. + * Convert the object to a JSON string representation for debugging. * - * @return string JSON encoded string of the object properties. + * This method is intended for debugging purposes only and provides + * a JSON representation of the object's state. + * + * @return string The JSON representation of the object. */ public function __toString() { diff --git a/src/Database/PicoTableInfo.php b/src/Database/PicoTableInfo.php index e1fa849b..62e4f0bb 100644 --- a/src/Database/PicoTableInfo.php +++ b/src/Database/PicoTableInfo.php @@ -141,6 +141,8 @@ public function __toString() $stdClass->autoIncrementKeys = $this->autoIncrementKeys; $stdClass->defaultValue = $this->defaultValue; $stdClass->notNullColumns = $this->notNullColumns; + $stdClass->this->noCache = $this->noCache; + $stdClass->package = $this->package; return json_encode($stdClass); }