From ebda7326d4a65e53bc5bb915ebbbeee98f1926b0 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Feb 2019 21:08:31 -0500 Subject: [PATCH] Add comment to explain why properties are set the way they are. --- src/Chronos.php | 2 ++ src/Date.php | 2 ++ src/MutableDate.php | 2 ++ src/MutableDateTime.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/Chronos.php b/src/Chronos.php index f03d8d71..30a271ac 100644 --- a/src/Chronos.php +++ b/src/Chronos.php @@ -190,6 +190,8 @@ public static function hasTestNow() */ public function __debugInfo() { + // Conditionally add properties if state exists to avoid + // errors when using a debugger. $vars = get_object_vars($this); $properties = [ diff --git a/src/Date.php b/src/Date.php index 7cfea762..387d0a94 100644 --- a/src/Date.php +++ b/src/Date.php @@ -133,6 +133,8 @@ public function toMutable() */ public function __debugInfo() { + // Conditionally add properties if state exists to avoid + // errors when using a debugger. $vars = get_object_vars($this); $properties = [ diff --git a/src/MutableDate.php b/src/MutableDate.php index 2cacf11c..00ea85bf 100644 --- a/src/MutableDate.php +++ b/src/MutableDate.php @@ -132,6 +132,8 @@ public function toImmutable() */ public function __debugInfo() { + // Conditionally add properties if state exists to avoid + // errors when using a debugger. $vars = get_object_vars($this); $properties = [ diff --git a/src/MutableDateTime.php b/src/MutableDateTime.php index 5b07a386..c97ffe18 100644 --- a/src/MutableDateTime.php +++ b/src/MutableDateTime.php @@ -175,6 +175,8 @@ public function __set($name, $value) */ public function __debugInfo() { + // Conditionally add properties if state exists to avoid + // errors when using a debugger. $vars = get_object_vars($this); $properties = [