Skip to content

Commit

Permalink
VarDumper: add ability to style doubles and integers independently
Browse files Browse the repository at this point in the history
  • Loading branch information
1ma committed Jul 3, 2021
1 parent 2911e70 commit 7249c87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
5.4
---

* Add ability to style integer and double values independently
* Add casters for Symfony's UUIDs and ULIDs

5.2.0
Expand Down
9 changes: 9 additions & 0 deletions Dumper/CliDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,20 @@ public function dumpScalar(Cursor $cursor, string $type, $value)

case 'integer':
$style = 'num';

if (isset($this->styles['integer'])) {
$style = 'integer';
}

break;

case 'double':
$style = 'num';

if (isset($this->styles['float'])) {
$style = 'float';
}

switch (true) {
case \INF === $value: $value = 'INF'; break;
case -\INF === $value: $value = '-INF'; break;
Expand Down

0 comments on commit 7249c87

Please sign in to comment.