{"id":37234428,"url":"https://github.com/era269/normalizable","last_synced_at":"2026-01-15T03:59:04.875Z","repository":{"id":43074364,"uuid":"332309611","full_name":"era269/normalizable","owner":"era269","description":"Normalizable object functionality. Object can give its normalized view without any external access to its private properties.","archived":false,"fork":false,"pushed_at":"2022-03-20T10:17:12.000Z","size":137,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T17:25:59.705Z","etag":null,"topics":["encapsulation","normalization","normalize","serializer"],"latest_commit_sha":null,"homepage":"","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/era269.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":"2021-01-23T21:17:10.000Z","updated_at":"2022-01-22T17:44:49.000Z","dependencies_parsed_at":"2022-08-30T21:12:18.840Z","dependency_job_id":null,"html_url":"https://github.com/era269/normalizable","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/era269/normalizable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fnormalizable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fnormalizable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fnormalizable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fnormalizable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/era269","download_url":"https://codeload.github.com/era269/normalizable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fnormalizable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","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":["encapsulation","normalization","normalize","serializer"],"created_at":"2026-01-15T03:59:04.359Z","updated_at":"2026-01-15T03:59:04.864Z","avatar_url":"https://github.com/era269.png","language":"PHP","readme":"# normalizable\n\n![PHP Stan Badge](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg?style=flat\"\u003e)\n[![codecov](https://codecov.io/gh/era269/normalizable/branch/main/graph/badge.svg?token=GV9Z0721OI)](https://codecov.io/gh/era269/normalizable)\n\nThe normalization which is under the object control.\n\n1. All private object properties should be ready for normalization. the normalization process is easy to customize by\n   adding or changing the sequence of the normalizers in the `NormalizationFacade`\n2. To allow the normalization customization Object has to implement the next interfaces:\n    1. `NormalizableInterface`\n    2. `NormalizationFacadeInterface`\n\n## Description:\n\n### NormalizableInterface\n\nThe basic interface. Could be used separately to build fully manual normalization. How:\n\n1. any objet implements `NormalizableInterface`\n2. It is called object::normalize in `NormalizableInterface::normalize` for all required to be present in normalized\n   view objects\n\n### NormalizableTrait\n\nIf it is needed to have all normalization happen automatically then `NormalizableTrait` has to be used\nwith `NormalizableInterface`. In that case all objects should be supported by the `DefaultNormalizationFacade`\n\n#### DefaultNormalizationFacade\n\nWill normalize all private object properties by the next rules:\n\n1. `AsIsKeyDecorator` the property name will become the array key without any decorations\n2. all properties will be processed by predefined normalizers:\n    1. `NotObjectNormalizer` will return not objects as is\n    2. `ListNormalizableToNormalizableAdapterNormalizer` will process the array of normalizable objects\n        1. all keys will be left as is `AsIsKeyDecorator`\n        2. all values will be processed in according to the current rules by `DefaultNormalizationFacade`\n    3. `NormalizableNormalizer` will call `NormalizableInterface::normalize`\n    4. `WithTypeNormalizableNormalizerDecorator` is decorates the `NormalizableNormalizer` to add `@type` field with\n       ShortClassName of normalized object\n    5. `ScalarableNormalizer` will get the scalar value in object implements `ScalarableInterface`\n    6. `StringableNormalizer` will get the scalar value in object implements `StringableInterface`\n    7. and the last one is `FailNormalizer` which wil throw an exception if no Normalizer was found\n\n### NormalizationFacadeAwareInterface\n\nShould be implenented by all Normalizable objects to support the normalization customization. The normalization should\nbe initiated by the custom `NormalizationFacade` implementation and it will be set to all Normalizable objects\nrecursively \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fera269%2Fnormalizable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fera269%2Fnormalizable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fera269%2Fnormalizable/lists"}