Skip to content

Commit

Permalink
Namespacing and README update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghostff committed Feb 2, 2020
1 parent f990c58 commit 50c17e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ Class Foo extends Bar {
```php
class FooBar
{
private $inherited_int = 123;
private $inherited_bool = ['string'];
private $inherited_int = 123;
private $inherited_array = ['string'];
}

class Bar extends FooBar
{
private $inherited_float = 0.22;
private $inherited_bool = 1 == '1';
private $inherited_bool = 1 == '1';
}

class Foo extends Bar
{
private $string = 'string';
protected $int = 10;
public $array = [
'foo' => 'bar'
protected $int = 10;
public $array = [
'foo' => 'bar'
];
protected static $bool = false;
}
Expand Down Expand Up @@ -88,6 +88,7 @@ new Dump(new Foo, $string, $array, $int, $double, $null, $bool, [
], $resource);

new Dump(1 == '1', 1 === '1');
Dump::safe(...$args); # running on terminal without color capabilities.
```
Replacing predefined colors:
```php
Expand All @@ -105,22 +106,3 @@ CLI(Unix):
CLI(Window):

![cli screenshot](https://github.com/Ghostff/Dump7/blob/master/posixWin.png)

Windows user runing on terminal without color capabilities, can use `Dump::safe` method:
```php
Dump::safe(new Foo, $string, $array, $int, $double, $null, $bool, $resource, [
'foo' => 'bar',
'bar' => 'foo',
[
'foo' => 'foobar',
'bar_foo',
2 => 'foo',
'foo' => [
'barbar' => 55,
'foofoo' => false,
'foobar' => null,
]
]
]);
```
CLI Windows output:
2 changes: 1 addition & 1 deletion src/Dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ private function formatObject($object): string
return $this->color('...', 'recursion');
}

$reflection = new ReflectionObject($object);
$reflection = new \ReflectionObject($object);
$class_name = $reflection->getName();
$properties = [];
$tmp = '';
Expand Down

0 comments on commit 50c17e7

Please sign in to comment.