https://github.com/joubertredrat/deeper
Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.DeepEqual().
https://github.com/joubertredrat/deeper
library php php-library php7 php8
Last synced: about 1 year ago
JSON representation
Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.DeepEqual().
- Host: GitHub
- URL: https://github.com/joubertredrat/deeper
- Owner: joubertredrat
- License: mit
- Created: 2021-11-26T00:07:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-03T22:02:59.000Z (over 4 years ago)
- Last Synced: 2025-03-23T22:37:04.355Z (over 1 year ago)
- Topics: library, php, php-library, php7, php8
- Language: PHP
- Homepage: https://packagist.org/packages/redrat/deeper
- Size: 33.2 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Deeper
Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's [reflect.DeepEqual()](https://pkg.go.dev/reflect#DeepEqual).
Deeper supports parent class with any kind of access attributes, public, protected and private. Deeper validates objects as atribbutes too, then, while have objects to test, Deeper will test recursively.
### Installation
```bash
composer require redrat/deeper
```
### Usage
It's very easy, create instance of Deeper object with objects to compare and check if it deep equal, like example below.
```php
use RedRat\Deeper\Deeper;
$deeper = new Deeper($objectOne, $objectTwo);
$deeper->isEqual(); // if have same values on both objects, return TRUE
```
### Known limitations
Some PHP core objects can't work properly, in this case, open an issue for we create a custom validation for this object.
### Author
[](https://joubertredrat.github.io)
[](https://github.com/joubertredrat/Deeper/graphs/contributors)
### License
The cute and amazing [MIT](https://github.com/joubertredrat/Deeper/blob/master/license).