{"id":21069674,"url":"https://github.com/wrk-flow/php-get-typed-value","last_synced_at":"2025-05-16T04:34:33.171Z","repository":{"id":40737544,"uuid":"507965695","full_name":"wrk-flow/php-get-typed-value","owner":"wrk-flow","description":"Get typed (strict mode) values from an Array / XML with basic validation.","archived":false,"fork":false,"pushed_at":"2024-03-27T12:59:19.000Z","size":2181,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T13:35:41.609Z","etag":null,"topics":["array","php","strict-types","strictmode","xml"],"latest_commit_sha":null,"homepage":"https://php-get-typed-value.wrk-flow.com","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/wrk-flow.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-27T15:34:00.000Z","updated_at":"2023-03-16T16:02:48.000Z","dependencies_parsed_at":"2022-09-13T10:00:59.403Z","dependency_job_id":"cb7aaaee-f130-491b-a338-2530dc9e6966","html_url":"https://github.com/wrk-flow/php-get-typed-value","commit_stats":{"total_commits":38,"total_committers":2,"mean_commits":19.0,"dds":"0.052631578947368474","last_synced_commit":"c7629498c665cdaaedf673055eafdad4ef294059"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrk-flow%2Fphp-get-typed-value","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrk-flow%2Fphp-get-typed-value/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrk-flow%2Fphp-get-typed-value/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrk-flow%2Fphp-get-typed-value/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrk-flow","download_url":"https://codeload.github.com/wrk-flow/php-get-typed-value/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254470303,"owners_count":22076566,"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":["array","php","strict-types","strictmode","xml"],"created_at":"2024-11-19T18:36:34.218Z","updated_at":"2025-05-16T04:34:28.162Z","avatar_url":"https://github.com/wrk-flow.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-get-typed-value\n\n![img](https://img.shields.io/badge/PHPStan-8-blue)\n![php](https://img.shields.io/badge/PHP-8.1-B0B3D6)\n![coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/pionl/11b884c06da0bf9116ae763d23438ecb/raw/coverage.json)\n\nGet typed (strict mode) values from an Array / XML with basic validation.\n\n```bash\ncomposer require wrkflow/php-get-typed-value\n```\n\n## Main features\n\n- 🚀 Retrieve values from Array (JSON) / XML with correct return type with **safe dot notation** support.\n- 🏆 **Makes PHPStan / IDE** happy due the type strict return types.\n- 🤹‍ **Validation:** Ensures that desired value is in correct type (without additional loop validation).\n- 🛠 **Transformers:** Ensures that values are in expected type.\n- ⛑ Converts empty string values to null (can be disabled, see transformers).\n\n```php\nuse Wrkflow\\GetValue\\GetValue;\nuse Wrkflow\\GetValue\\DataHolders\\ArrayData;\n\n$data = new GetValue(new ArrayData([\n    'address' =\u003e [\n        'street' =\u003e [\n            'number' =\u003e '13',\n        ],\n        'name' =\u003e '',\n    ]   \n]));\n$data-\u003egetInt('address.street.number') // Returns: 13 (int)\n$data-\u003egetString('address.street.name') // Returns: null because value does not exists\n$data-\u003egetRequiredString('address.street.name') // Returns: throws MissingValueForKeyException exception\n```\n\n## Documentation\n\nDocumentation is hosted on [GitHub Pages](https://php-get-typed-value.wrk-flow.com).\n\n## Comment\n\nI've created this project as part of my mission to create `work flow` tools / libraries to make my (and yours) **dev\nlife easier and more enjoyable**.\n\nWant more tools or want to help? Check [wrk-flow.com](https://wrk-flow.com) or [CONTRIBUTE](CONTRIBUTION.md). You can\nhelp me improve the documentation, add new tests and features. Are you junior developer? Don't be scared, get in touch\nand I will guide you in your first contribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrk-flow%2Fphp-get-typed-value","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrk-flow%2Fphp-get-typed-value","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrk-flow%2Fphp-get-typed-value/lists"}