{"id":16410546,"url":"https://github.com/skipperbent/dot-notation","last_synced_at":"2026-05-17T19:02:55.873Z","repository":{"id":57037377,"uuid":"53955206","full_name":"skipperbent/dot-notation","owner":"skipperbent","description":"Dot notation support for JSON-like syntax for easily creating arrays in PHP.","archived":false,"fork":false,"pushed_at":"2017-12-17T02:37:54.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"v2-release","last_synced_at":"2025-09-05T12:01:25.728Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skipperbent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-15T15:17:46.000Z","updated_at":"2022-01-03T10:51:32.000Z","dependencies_parsed_at":"2022-08-23T21:00:18.348Z","dependency_job_id":null,"html_url":"https://github.com/skipperbent/dot-notation","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/skipperbent/dot-notation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fdot-notation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fdot-notation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fdot-notation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fdot-notation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skipperbent","download_url":"https://codeload.github.com/skipperbent/dot-notation/tar.gz/refs/heads/v2-release","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fdot-notation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33151625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"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-10-11T06:43:15.043Z","updated_at":"2026-05-17T19:02:55.843Z","avatar_url":"https://github.com/skipperbent.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pecee/dot-notation\nDot notation support for JSON-like syntax for easily creating and mapping arrays in PHP.\n\n## Installation\nRun the following command in terminal to add the latest version of pecee/dot-notation library to your project.\n\n```\ncomposer require pecee/dot-notation\n```\n\n## Examples\n\nThis example returns an array from a basic dot formatted string, similar to the JSON syntax:\n\n```php\n$d = new \\Pecee\\DotNotation(['one' =\u003e ['two' =\u003e 2]]);\n$d-\u003eset('one.two', 3);\necho $d-\u003egetValues();\n```\n\n**Output:**\n\n```php\narray ('one' =\u003e ['two' =\u003e 3]);\n```\n\n### Easily map one array to another\n\n```php\nclass CustomerMapper {\n\n    protected $customer;\n\n    public function __construct(array $values) {\n    \n        // Map fields (from -\u003e to)\n    \n        $this-\u003ecustomer = $this-\u003emap($values, [\n            'customerId' =\u003e 'id',\n            'relationshipStatus' =\u003e 'relationship_status',\n            'customerGender' =\u003e 'gender',\n            'meta.name' =\u003e 'name',\n        ]);\n    }\n\n    protected function map(array $input, array $mapping) {\n        $output = array();\n    \n        foreach($mapping as $before =\u003e $after) {\n    \n            $map = new DotNotation($input);\n            $value = $map-\u003eget($before);\n    \n            $map = new DotNotation($output);\n            $map-\u003eset($after, $value);\n            $output = $map-\u003egetValues();\n        }\n    \n        return $output;\n    }\n    \n    protected function getCustomer() {\n        return $this-\u003ecustomer;\n    }\n}\n\n// Example:\n\n$mapper = new CustomerMapper([\n    'customerId' =\u003e 123456,\n    'relationshipStatus' =\u003e 'single',\n    'customerGender' =\u003e 'male',\n    'meta' =\u003e ['name' =\u003e 'Peter']\n]);\n\n$customer = $mapper-\u003egetCustomer();\n```\n\n**Output:**\n\n```php\narray(\n    'id' =\u003e 123456,\n    'relationship_status' =\u003e 'single',\n    'gender' =\u003e 'male',\n    'name' =\u003e 'Peter',\n);\n```\n\n### Credits\nelfet\n\n## The MIT License (MIT)\n\nCopyright (c) 2016 Simon Sessingø / pecee\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskipperbent%2Fdot-notation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskipperbent%2Fdot-notation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskipperbent%2Fdot-notation/lists"}