{"id":16137291,"url":"https://github.com/sylvrs/libmarshal","last_synced_at":"2025-10-25T08:36:07.408Z","repository":{"id":38326829,"uuid":"476062581","full_name":"sylvrs/libMarshal","owner":"sylvrs","description":"A small marshalling library used to encode/decode data from classes","archived":false,"fork":false,"pushed_at":"2024-06-16T03:25:38.000Z","size":396,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T06:23:13.470Z","etag":null,"topics":["marshal","php","unmarshal"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sylvrs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-30T21:51:20.000Z","updated_at":"2024-12-25T19:58:37.000Z","dependencies_parsed_at":"2024-06-16T03:48:03.561Z","dependency_job_id":null,"html_url":"https://github.com/sylvrs/libMarshal","commit_stats":{"total_commits":131,"total_committers":4,"mean_commits":32.75,"dds":0.03816793893129766,"last_synced_commit":"8dc35c1a0740c177d4f4459681bad84140f80cf1"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvrs%2FlibMarshal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvrs%2FlibMarshal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvrs%2FlibMarshal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvrs%2FlibMarshal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sylvrs","download_url":"https://codeload.github.com/sylvrs/libMarshal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809844,"owners_count":20351406,"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":["marshal","php","unmarshal"],"created_at":"2024-10-09T23:26:11.587Z","updated_at":"2025-10-25T08:36:02.363Z","avatar_url":"https://github.com/sylvrs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libMarshal\nA small marshalling library used to encode/decode data from classes.\n\n## Installation\n### Composer\nTo install this library through composer, run the following command:\n```\ncomposer require sylvrs/libmarshal\n```\n### Virion\nThe virion for this library can be accessed [here](https://poggit.pmmp.io/ci/sylvrs/libMarshal/libMarshal).\n\n## Basic Example\nHere is a basic example on how this library is used:\n```php\nclass User {\n\tuse MarshalTrait;\n\t\n\tpublic function __construct(\n            #[Field(name: \"first-name\")]\n            public string $firstName,\n            #[Field(name: \"last-name\")]\n            public string $lastName,\n            public int $age,\n            public string $email,\n            #[Exclude]\n            public string $internalData = \"...\"\n\t) {}\n}\n\n// NOTE: This uses promoted properties to make it easier to construct.\n// You can learn more about this below.\n\n// Marshalling\n$user = new User(firstName: \"John\", lastName: \"Doe\", age: 30, email: \"johndoe@gmail.com\");\n$data = $user-\u003emarshal(); // [\"first-name\" =\u003e \"John\", \"last-name\" =\u003e \"Doe\", \"age\" =\u003e 30, \"email\" =\u003e \"johndoe@gmail.com\"]\n\n$data[\"first-name\"] = \"Jane\"; // Changing the first name\n$data[\"email\"] = \"janedoe@gmail.com\"; // Changing the email\n\n// Unmarshalling\n$user = User::unmarshal($data); // User(firstName: \"Jane\", lastName: \"Doe\", age: 30, email: \"janedoe@gmail.com\")\n```\n\n## Wiki\nTo learn about how to use the library, please consult the wiki [here](https://github.com/sylvrs/libMarshal/wiki).\n\n## Roadmap\nAt the moment, there are a few improvements that can be/or are being worked on. Here is a list of some of those improvements:\n- [ ] Add a limit to recursive objects when marshalling/unmarshalling (50?)\n- [X] Cache properties for performance benefits\n\n## Issues\nAny issues/suggestions can be reported [here](https://github.com/sylvrs/libMarshal/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvrs%2Flibmarshal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsylvrs%2Flibmarshal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvrs%2Flibmarshal/lists"}