{"id":36280022,"url":"https://github.com/jerodev/data-mapper","last_synced_at":"2026-01-11T09:02:57.094Z","repository":{"id":175636850,"uuid":"310634647","full_name":"jerodev/data-mapper","owner":"jerodev","description":"Maps raw data into a strong-typed PHP object","archived":false,"fork":false,"pushed_at":"2025-12-31T15:05:02.000Z","size":185,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-04T19:30:02.881Z","etag":null,"topics":["classes","json","objects","php"],"latest_commit_sha":null,"homepage":"https://docs.deviaene.eu/data-mapper/","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/jerodev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-06T15:29:44.000Z","updated_at":"2025-12-31T15:05:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"3cf5bae6-e26c-448a-ae39-fada20e277d3","html_url":"https://github.com/jerodev/data-mapper","commit_stats":null,"previous_names":["jerodev/data-mapper"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jerodev/data-mapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerodev%2Fdata-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerodev%2Fdata-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerodev%2Fdata-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerodev%2Fdata-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerodev","download_url":"https://codeload.github.com/jerodev/data-mapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerodev%2Fdata-mapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28298876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T08:21:30.231Z","status":"ssl_error","status_checked_at":"2026-01-11T08:21:26.882Z","response_time":60,"last_error":"SSL_read: 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":["classes","json","objects","php"],"created_at":"2026-01-11T09:02:57.027Z","updated_at":"2026-01-11T09:02:57.086Z","avatar_url":"https://github.com/jerodev.png","language":"PHP","readme":"# Data Mapper\n![run-tests](https://github.com/jerodev/data-mapper/workflows/run-tests/badge.svg) [![Latest Stable Version](http://poser.pugx.org/jerodev/data-mapper/v)](https://packagist.org/packages/jerodev/data-mapper) \n\nThis package will map any raw data into a predefined strong-typed PHP object.\n\n## Installation\nThe mapper has no external dependencies apart from PHP8.1 or higher. It can be installed using composer:\n\n```bash\ncomposer require jerodev/data-mapper\n```\n\n## Basic mapping\nLet's start with the basics. The mapper will map data directly to public properties on objects. If these properties have\ntypes defined either using types introduced in PHP7.4 or through [PHPDoc](https://phpstan.org/writing-php-code/phpdoc-types), the mapper will attempt to cast the data to these\ntypes.\n\nFor example: imagine having an `Entity` class with the public properties `$id` and `$name`:\n\n```php\nclass User\n{\n    public int $id;\n    public string $name;\n}\n```\n\nTo map data from an array we simply pass the class name and an array with data to the mapper.\n\n```php\n$mapper = new \\Jerodev\\DataMapper\\Mapper();\n$entity = $mapper-\u003emap(User::class, [\n    'id' =\u003e '5',\n    'name' =\u003e 'John Doe',\n]);\n\n//    User {\n//        +id: 5,\n//        +name: \"John Doe\",\n//    }\n```\n\nThis is a simple example, but the mapper can also map nested objects, arrays of objects, keyed arrays, and even multi-level arrays.\n\n## Documentation\nMore information about mapping, configuration and best practices can be found in [the documentation](https://docs.deviaene.eu/data-mapper/).\n\n## License\nThis library is licensed under the MIT License (MIT). Please see [License File](license.md) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerodev%2Fdata-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerodev%2Fdata-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerodev%2Fdata-mapper/lists"}