Skip to content

Commit

Permalink
Add comment to explain why properties are set the way they are.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 11, 2019
1 parent 8ee5ec5 commit ebda732
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Chronos.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 2 additions & 0 deletions src/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 2 additions & 0 deletions src/MutableDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 2 additions & 0 deletions src/MutableDateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit ebda732

Please sign in to comment.