{"id":36294243,"url":"https://github.com/era269/micro-object","last_synced_at":"2026-01-11T10:01:48.834Z","repository":{"id":43074949,"uuid":"317518340","full_name":"era269/micro-object","owner":"era269","description":"Object as microservise: can process message-request, return message-response and dispatch\\apply events","archived":false,"fork":false,"pushed_at":"2022-03-20T08:44:04.000Z","size":169,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-19T06:56:27.101Z","etag":null,"topics":["event-dispatching","event-driven","event-sourcing","message","microservice","oop","php"],"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":"2020-12-01T11:21:45.000Z","updated_at":"2021-05-22T21:29:41.000Z","dependencies_parsed_at":"2022-09-10T23:12:44.310Z","dependency_job_id":null,"html_url":"https://github.com/era269/micro-object","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/era269/micro-object","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fmicro-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fmicro-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fmicro-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fmicro-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/era269","download_url":"https://codeload.github.com/era269/micro-object/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/era269%2Fmicro-object/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28299709,"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":["event-dispatching","event-driven","event-sourcing","message","microservice","oop","php"],"created_at":"2026-01-11T10:01:48.238Z","updated_at":"2026-01-11T10:01:48.830Z","avatar_url":"https://github.com/era269.png","language":"PHP","readme":"# micro-object\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/micro-object/branch/master/graph/badge.svg?token=H6VK60D706)](https://codecov.io/gh/era269/micro-object)\n## OOP\n\n\nThe library just gives functionality of Message Prcessing and Event Dispatching.\nOnly one case is described in the Example. See:\n* NotebooksPort.php\n* NotebookPortTest.php\n\n### process\n\n\n#### Performance\nwas used modified `\\Era269\\Microobject\\Example\\Tests\\NotebookPortTest::testGetText` method\n##### Cached\ndefault `\\Era269\\Microobject\\Traits\\CanGetMethodNameByMessageTrait` functionality\n```php\n    public function testGetText(EventStorageInterface $eventStorage): void\n    {\n        $notebooksPort = $this-\u003egetAutowiredNotebookPort($eventStorage);\n\n        echo \"\\n start: \" . var_dump($start = hrtime()) . \"\\n\";\n        for ($i = 0; $i \u003c= 1000; $i++) {\n            $normalizedTextResponse = $notebooksPort\n                -\u003egetText([\n                    'notebookId' =\u003e self::UNIQUE_ID_NOTEBOOK,\n                    'pageId' =\u003e self::UNIQUE_ID_PAGE,\n                ]);\n        }\n        echo \"\\n end: \" . var_dump($end = hrtime()) . \"\\n\";\n        printf(\"\\n ----------------time-------\\n %d.%d ms \\n\", $end[0] - $start[0], abs($end[1] - $start[1]));\n\n        $expectedText = [\n            'first line',\n            'second line',\n            'third line',\n        ];\n\n        self::assertEquals($expectedText, $normalizedTextResponse['payload']['lines']);\n    }\n```\noutput:\n```\narray(2) {\n  [0]=\u003e\n  int(131238)\n  [1]=\u003e\n  int(855914676)\n}\n\n start: \narray(2) {\n  [0]=\u003e\n  int(131238)\n  [1]=\u003e\n  int(888507531)\n}\n\n end: \n\n ----------------avereage-time-------\n 0.32592855 ms \n```\n#### Without any cache:\nmodified `\\Era269\\Microobject\\Traits\\CanGetMethodNameByMessageTrait` functionality\n\n```php\n    private static function getMap(string $className): array\n    {\n//        if (!empty(static::$methodNamesMap[$className])) {\n//            return static::$methodNamesMap[$className];\n//        }\n\n```\noutput:\n```\narray(2) {\n  [0]=\u003e\n  int(131658)\n  [1]=\u003e\n  int(190087943)\n}\n\n start: \narray(2) {\n  [0]=\u003e\n  int(131658)\n  [1]=\u003e\n  int(275028022)\n}\n\n end: \n\n ----------------avereage-time-------\n 0.84940079 ms\n ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fera269%2Fmicro-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fera269%2Fmicro-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fera269%2Fmicro-object/lists"}