{"id":20180604,"url":"https://github.com/ergebnis/json","last_synced_at":"2025-04-10T05:02:25.220Z","repository":{"id":64558566,"uuid":"576606010","full_name":"ergebnis/json","owner":"ergebnis","description":"📃 Provides a composer package with a Json value object for representing a valid JSON string.","archived":false,"fork":false,"pushed_at":"2024-04-25T07:00:42.000Z","size":1410,"stargazers_count":18,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-01T11:41:18.395Z","etag":null,"topics":["json"],"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/ergebnis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ergebnis","localheinz"]}},"created_at":"2022-12-10T11:40:18.000Z","updated_at":"2024-05-07T07:43:08.248Z","dependencies_parsed_at":"2024-01-26T07:28:51.223Z","dependency_job_id":"8ec008b5-678a-4371-b901-916ede4e69cc","html_url":"https://github.com/ergebnis/json","commit_stats":{"total_commits":64,"total_committers":3,"mean_commits":"21.333333333333332","dds":0.25,"last_synced_commit":"dfa2ed536cf4153428d8e1478ce542598f48956a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":"ergebnis/php-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ergebnis","download_url":"https://codeload.github.com/ergebnis/json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161267,"owners_count":21057554,"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"],"created_at":"2024-11-14T02:31:59.750Z","updated_at":"2025-04-10T05:02:25.145Z","avatar_url":"https://github.com/ergebnis.png","language":"PHP","funding_links":["https://github.com/sponsors/ergebnis","https://github.com/sponsors/localheinz"],"categories":[],"sub_categories":[],"readme":"# json\n\n[![Integrate](https://github.com/ergebnis/json/workflows/Integrate/badge.svg)](https://github.com/ergebnis/json/actions)\n[![Merge](https://github.com/ergebnis/json/workflows/Merge/badge.svg)](https://github.com/ergebnis/json/actions)\n[![Release](https://github.com/ergebnis/json/workflows/Release/badge.svg)](https://github.com/ergebnis/json/actions)\n[![Renew](https://github.com/ergebnis/json/workflows/Renew/badge.svg)](https://github.com/ergebnis/json/actions)\n\n[![Code Coverage](https://codecov.io/gh/ergebnis/json/branch/main/graph/badge.svg)](https://codecov.io/gh/ergebnis/json)\n\n[![Latest Stable Version](https://poser.pugx.org/ergebnis/json/v/stable)](https://packagist.org/packages/ergebnis/json)\n[![Total Downloads](https://poser.pugx.org/ergebnis/json/downloads)](https://packagist.org/packages/ergebnis/json)\n[![Monthly Downloads](http://poser.pugx.org/ergebnis/json/d/monthly)](https://packagist.org/packages/ergebnis/json)\n\nThis project provides a [`composer`](https://getcomposer.org) package with a `Json` value object for representing a valid JSON `string`.\n\n## Installation\n\nRun\n\n```sh\ncomposer require ergebnis/json\n```\n\n## Usage\n\n### Create a `Json` object from `string`\n\nCreate a `Json` object from a `string`:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Json;\n\n$encoded = \u003c\u003c\u003cTXT\n{\n  \"foo\nTXT;\n\n$json = Json\\Json::fromString($encoded); // throws Json\\Exception\\NotJson\n```\n\nCreate a `Json` object from a valid JSON `string`:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Json;\n\n$encoded = \u003c\u003c\u003cJSON\n{\n  \"foo\": \"bar\"\n}\nJSON;\n\n$json = Json\\Json::fromString($encoded); // instance of Json\\Json\n```\n\n### Create a `Json` object from a file\n\nCreate a `Json` object from a file that does not exist:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Json;\n\n$json = Json\\Json::fromFile(__DIR__ . '/does-not-exist.json'); // throws Json\\Exception\\FileDoesNotExist\n```\n\nCreate a `Json` object from a file that can not be read:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Json;\n\n$json = Json\\Json::fromFile(__DIR__ . '/can-not-be-read.json'); // throws Json\\Exception\\FileCanNotBeRead\n```\n\nCreate a `Json` object from a file that does not contain a valid JSON `string`:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Json;\n\n$json = Json\\Json::fromFile(__DIR__ . '/README.MD'); // throws Json\\Exception\\FileDoesNotContainJson\n```\n\nCreate a `Json` object from a file that contains a valid JSON `string`:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Json;\n\n$json = Json\\Json::fromFile(__DIR__ . '/contains-json.json'); // instance of Json\\Json\n```\n\n## Changelog\n\nThe maintainers of this project record notable changes to this project in a [changelog](CHANGELOG.md).\n\n## Contributing\n\nThe maintainers of this project suggest following the [contribution guide](.github/CONTRIBUTING.md).\n\n## Code of Conduct\n\nThe maintainers of this project ask contributors to follow the [code of conduct](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).\n\n## General Support Policy\n\nThe maintainers of this project provide limited support.\n\nYou can support the maintenance of this project by [sponsoring @localheinz](https://github.com/sponsors/localheinz) or [requesting an invoice for services related to this project](mailto:am@localheinz.com?subject=ergebnis/json:%20Requesting%20invoice%20for%20services).\n\n## PHP Version Support Policy\n\nThis project supports PHP versions with [active and security support](https://www.php.net/supported-versions.php).\n\nThe maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support.\n\n## Security Policy\n\nThis project has a [security policy](.github/SECURITY.md).\n\n## License\n\nThis project uses the [MIT license](LICENSE.md).\n\n## Social\n\nFollow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fergebnis%2Fjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fjson/lists"}