{"id":20827709,"url":"https://github.com/peridot-php/object-path","last_synced_at":"2026-03-10T00:31:28.671Z","repository":{"id":35366469,"uuid":"39629331","full_name":"peridot-php/object-path","owner":"peridot-php","description":"A string syntax to fetch values from array and object hierarchies","archived":false,"fork":false,"pushed_at":"2015-07-24T11:38:47.000Z","size":120,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-26T00:46:44.032Z","etag":null,"topics":[],"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/peridot-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-24T11:31:48.000Z","updated_at":"2025-02-06T04:16:23.000Z","dependencies_parsed_at":"2022-08-25T13:41:22.453Z","dependency_job_id":null,"html_url":"https://github.com/peridot-php/object-path","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/peridot-php/object-path","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fobject-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fobject-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fobject-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fobject-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peridot-php","download_url":"https://codeload.github.com/peridot-php/object-path/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fobject-path/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30318388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-17T23:12:49.646Z","updated_at":"2026-03-10T00:31:28.651Z","avatar_url":"https://github.com/peridot-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ObjectPath [![Build Status](https://travis-ci.org/peridot-php/object-path.svg?branch=master)](https://travis-ci.org/peridot-php/object-path)\n\nAllows traversal of objects and arrays with a simple string syntax. Extracted from\nPeridot's matcher library: [Leo](https://github.com/peridot-php/leo).\n\n## Usage\n\n```php\n$data = [\n  'name' =\u003e 'Brian',\n  'hobbies' =\u003e [\n    'reading',\n    'programming',\n    'lion taming'  \n  ],\n  'address' =\u003e [\n    'street' =\u003e '1234 Lane',\n    'zip' =\u003e '12345'  \n  ]\n];\n\nuse Peridot\\ObjectPath\\ObjectPath;\n\n$path = new ObjectPath($data);\n$reading = $path-\u003eget('hobbies[0]');\n$zip = $path-\u003eget('address[zip]');\n\n// the result of get() is an ObjectPathValue instance\n$value = $reading-\u003egetPropertyValue();\n\n// The syntax also works for objects and nested structures\n\n$data = new stdClass();\n\n$data-\u003ename = 'Brian';\n$data-\u003eaddress = new stdClass();\n$data-\u003eaddress-\u003ezip = '12345';\n\n$hobby = new stdClass();\n$hobby-\u003ename = 'reading';\n$hobby-\u003estyle = 'relaxing';\n$data-\u003ehobbies = [$hobby];\n\n$path = new ObjectPath($data);\n$name = $path-\u003eget('name');\n$zip = $path-\u003eget('address-\u003ezip');\n$reading = $path-\u003eget('hobbies[0]-\u003ename');\n```\n\n## Tests\n\n```\n$ composer install\n$ vendor/bin/peridot specs/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperidot-php%2Fobject-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperidot-php%2Fobject-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperidot-php%2Fobject-path/lists"}