{"id":17085731,"url":"https://github.com/everzet/persisted-objects","last_synced_at":"2025-04-06T12:09:22.547Z","repository":{"id":24690660,"uuid":"28101830","full_name":"everzet/persisted-objects","owner":"everzet","description":"Stupid PHP library to do very simple persistance for test automation purposes","archived":false,"fork":false,"pushed_at":"2019-10-10T09:11:33.000Z","size":21,"stargazers_count":130,"open_issues_count":1,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T11:07:08.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"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/everzet.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":"2014-12-16T19:06:27.000Z","updated_at":"2024-05-15T11:03:23.000Z","dependencies_parsed_at":"2022-07-12T16:07:52.852Z","dependency_job_id":null,"html_url":"https://github.com/everzet/persisted-objects","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everzet%2Fpersisted-objects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everzet%2Fpersisted-objects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everzet%2Fpersisted-objects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everzet%2Fpersisted-objects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/everzet","download_url":"https://codeload.github.com/everzet/persisted-objects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478323,"owners_count":20945266,"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":[],"created_at":"2024-10-14T13:25:50.223Z","updated_at":"2025-04-06T12:09:22.525Z","avatar_url":"https://github.com/everzet.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Persisted Objects\n\nThis repository is a collection of repositories (pun intended) that somebody might find useful\nin training or testing exercises. They provide an easy way to create Fakes for your repositories\nin the test infrastructure.\n\n### Why?\n\nAs stated in the header - for testing and demo purposes. These repos are optimised for cases where\nyou have less than 20 records in your repository and there's always only one user accessing it at\na time. In these particular cases these repositories are faster. But in every other instance\nthey're exponentially not.\n\n### Usage\n\nInstall with:\n\n```\n$\u003e composer require --dev everzet/persisted-objects\n```\n\nUse like this:\n\n```php\n$repo = new FileRepository(TEMP_FILE, new AccessorObjectIdentifier('getId'));\n$repo-\u003esave($user);\n\n$user === $repo-\u003efindById($user-\u003egetId());\n\n$repo-\u003eclear();\n```\n\nor like this:\n\n\n```php\n$repo = new InMemoryRepository(new CallbackObjectIdentifier(\n    function($obj) { return $obj-\u003egetFirstname() . $obj-\u003egetLastname(); }\n);\n$repo-\u003esave($user);\n\n$user === $repo-\u003efindById($user-\u003egetFirstname() . $user-\u003egetLastname());\n\n$repo-\u003eclear();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverzet%2Fpersisted-objects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverzet%2Fpersisted-objects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverzet%2Fpersisted-objects/lists"}