{"id":17045733,"url":"https://github.com/remorhaz/php-json-data","last_synced_at":"2025-04-12T15:32:16.479Z","repository":{"id":60774650,"uuid":"73026797","full_name":"remorhaz/php-json-data","owner":"remorhaz","description":"JSON Data Accessors","archived":false,"fork":false,"pushed_at":"2024-02-17T12:55:51.000Z","size":142,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T10:03:25.929Z","etag":null,"topics":["json","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remorhaz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-11-06T23:51:49.000Z","updated_at":"2023-06-16T11:39:59.000Z","dependencies_parsed_at":"2024-02-17T13:49:26.311Z","dependency_job_id":null,"html_url":"https://github.com/remorhaz/php-json-data","commit_stats":{"total_commits":60,"total_committers":2,"mean_commits":30.0,"dds":"0.16666666666666663","last_synced_commit":"9d554873e60350fa54dcee38a8ca347701018f89"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorhaz%2Fphp-json-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorhaz%2Fphp-json-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorhaz%2Fphp-json-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorhaz%2Fphp-json-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remorhaz","download_url":"https://codeload.github.com/remorhaz/php-json-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248190506,"owners_count":21062282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","php"],"created_at":"2024-10-14T09:38:14.730Z","updated_at":"2025-04-12T15:32:16.451Z","avatar_url":"https://github.com/remorhaz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP JSON Data Accessors\n\n[![Latest Stable Version](https://poser.pugx.org/remorhaz/php-json-data/v/stable)](https://packagist.org/packages/remorhaz/php-json-data)\n[![Build Status](https://travis-ci.org/remorhaz/php-json-data.svg?branch=master)](https://travis-ci.org/remorhaz/php-json-data)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/remorhaz/php-json-data/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/remorhaz/php-json-data/?branch=master)\n[![codecov](https://codecov.io/gh/remorhaz/php-json-data/branch/master/graph/badge.svg)](https://codecov.io/gh/remorhaz/php-json-data)\n[![Total Downloads](https://poser.pugx.org/remorhaz/php-json-data/downloads)](https://packagist.org/packages/remorhaz/php-json-data)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fremorhaz%2Fphp-json-data%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/remorhaz/php-json-data/master)\n[![License](https://poser.pugx.org/remorhaz/php-json-data/license)](https://packagist.org/packages/remorhaz/php-json-data)\n\nThis library provides infrastructure for JSON documents processing.\n\n## Requirements\n\n- PHP 8.1 or newer.\n- [Internationalization functions](https://www.php.net/manual/en/book.intl.php) (ext-intl) - to compare Unicode strings.\n- [JSON extension](https://www.php.net/manual/en/book.json.php) (ext-json) - to encode and decode JSON documents.\n\n## Node Values\n`ValueInterface` can be used to represent JSON document or it's part. There is a set of descendant interfaces that provide access to typed values:\n\n- `ScalarValueInterface`\n- `ArrayValueInterface`\n- `ObjectValueInterface`\n\n`NodeValueInterface` includes information about value's path in the document, so it can be used to represent values that really exist in some JSON document. Calculated values that have no paths should implement basic `ValueInterface`. \n\n## Node Value Factories\nThis type of objects is intended to create node values from some source. This library includes two implementations of node value factories:\n\n- `DecodedJson\\NodeValueFactory` creates node value from raw PHP values (produced by `json_decode()` function or created manually).\n- `EncodedJson\\NodeValueFactory` creates node value directly from encoded JSON string.\n\n### Example\n```php\n\u003c?php\n\nuse Remorhaz\\JSON\\Data\\Value\\DecodedJson;\nuse Remorhaz\\JSON\\Data\\Value\\EncodedJson;\n\n// Both values represent same JSON document:\n$value1 = EncodedJson\\NodeValueFactory::create()-\u003ecreateValue('{\"a\":\"b\"}');\n$value2 = DecodedJson\\NodeValueFactory::create()-\u003ecreateValue((object) ['a' =\u003e 'b']);\n``` \n\n## Event Streams\nJSON document can be represented as a stream of events. These events implement descendants of `EventInterface`. Such events can be emitted by any custom JSON parser, but this library also implements standard `ValueWalker` object that converts any `NodeValueInterface` to event stream.\n\nValue walker is also able to use _mutations_ to alter the events. There're no standard mutations, you must implement `MutationInterface` by yourself.\n\nYou can also use `EventDecoder` object to convert event stream back to `NodeValueInterface`.\n\n## Value exporters\nLibrary includes a set of `ValueExporterInterface` implementations that allow to export `ValueInterface` to another representation:\n\n- `ValueEncoder` converts value to JSON-encoded string.\n- `ValueDecoder` converts value to raw PHP values.\n\n## Comparators\nLibrary includes a set of `ComparatorInterface` implementations that provide a simple way to compare/sort JSON documents:\n\n- `EqualValueComparator` checks for JSON documents equality. Note that objects with same properties in different order are considered equal.\n- `GreaterValueComparator` compares JSON numbers and strings.\n- `ContainsValueComparator` checks JSON documents either for equality or for containment. Containing object is allowed to have additional properties on any level of recursion. \n\n## License\n\nThis library is licensed under the MIT License. Please see [LICENSE](./LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremorhaz%2Fphp-json-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremorhaz%2Fphp-json-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremorhaz%2Fphp-json-data/lists"}