{"id":19766841,"url":"https://github.com/xmolecules/phpmolecules","last_synced_at":"2025-10-15T14:16:15.506Z","repository":{"id":62548385,"uuid":"349055229","full_name":"xmolecules/phpmolecules","owner":"xmolecules","description":"Libraries to help developers express architectural abstractions in PHP code","archived":false,"fork":false,"pushed_at":"2023-10-26T14:50:59.000Z","size":55,"stargazers_count":33,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-13T18:58:00.991Z","etag":null,"topics":["architecture","domain-driven-design","php"],"latest_commit_sha":null,"homepage":"https://xmolecules.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xmolecules.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-03-18T11:56:07.000Z","updated_at":"2025-10-13T14:41:01.000Z","dependencies_parsed_at":"2022-11-02T23:30:40.188Z","dependency_job_id":null,"html_url":"https://github.com/xmolecules/phpmolecules","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/xmolecules/phpmolecules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmolecules%2Fphpmolecules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmolecules%2Fphpmolecules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmolecules%2Fphpmolecules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmolecules%2Fphpmolecules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmolecules","download_url":"https://codeload.github.com/xmolecules/phpmolecules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmolecules%2Fphpmolecules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279085227,"owners_count":26100015,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["architecture","domain-driven-design","php"],"created_at":"2024-11-12T04:26:42.140Z","updated_at":"2025-10-15T14:16:15.477Z","avatar_url":"https://github.com/xmolecules.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpMolecules – Architectural Abstractions for PHP\n\nA set of libraries to help developers work with architectural concepts in PHP.\nMember of the xMolecules family.\nGoals:\n\n* Express that a piece of code (namespace, class, method...) implements an architectural concept.\n* Make it easy for the human reader to determine what kind of architectural concepts a given piece of code is.\n* Allow tool integration (to do interesting stuff like generating persistence or static architecture analysis to check for validations of the architectural rules.)\n\n## Expressing DDD Concepts\n\nExample:\n\n```php\nuse PHPMolecules\\DDD\\Attribute\\{Entity, ValueObject, Repository};\n\n#[Entity]\nclass BankAccount { /* ... */ }\n\n#[ValueObject]\nclass Currency { /* ... */ }\n\n#[Repository]\nclass Accounts { /* ... */ }\n```\n\nWhen we take Ubiquitous Language serious, we want names (for classes, methods, etc.) that only contain words from the domain language.\nThat means the titles of the building blocks should not be part of the names.\nSo in a banking domain we don't want `BankAccountEntity`, `CurrencyVO` or even `AccountRepository` as types.\nInstead, we want `BankAccount`, `Currency` and `Accounts` – like in the example above.\n\nStill, we want to express that a given class (or other architectural element) is a special building block; i.e. uses a design pattern.\nPHPMolecules provide a set of standard annotations for the building blocks known from DDD.\n\n## Expressing Architecture\n\nphpMolecules provides annotations to mark a package as a layer (or ring):\n\nTODO: port documentation from jMolecules.\n\n## Installation\n\nTo use phpMolecules in your project just install it with Composer from Packagist:\n\n```fish\ncomposer require xmolecules/phpmolecules\n```\n\n## Release Instructions\n\nCreate a new Git version tag and push it:\n\n```fish\ngit tag --sign vX.Y.Z\ngit push --tags\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmolecules%2Fphpmolecules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmolecules%2Fphpmolecules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmolecules%2Fphpmolecules/lists"}