{"id":13411413,"url":"https://github.com/thenlabs/class-builder","last_synced_at":"2026-01-16T00:38:33.107Z","repository":{"id":57068324,"uuid":"238961693","full_name":"thenlabs/class-builder","owner":"thenlabs","description":"Dynamic management of classes, traits and interfaces in PHP.","archived":false,"fork":false,"pushed_at":"2022-05-13T22:28:38.000Z","size":185,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"1.0","last_synced_at":"2024-09-18T02:22:42.999Z","etag":null,"topics":["builder","builder-pattern","php","php-builder","php-class","php-classes","php-interface","php-library","php-traits"],"latest_commit_sha":null,"homepage":"https://github.com/thenlabs/class-builder/blob/1.0/doc/es/index.md","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/thenlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-07T15:46:35.000Z","updated_at":"2024-06-15T20:17:17.000Z","dependencies_parsed_at":"2022-08-24T10:20:40.355Z","dependency_job_id":null,"html_url":"https://github.com/thenlabs/class-builder","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenlabs%2Fclass-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenlabs%2Fclass-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenlabs%2Fclass-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenlabs%2Fclass-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thenlabs","download_url":"https://codeload.github.com/thenlabs/class-builder/tar.gz/refs/heads/1.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243618614,"owners_count":20320268,"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":["builder","builder-pattern","php","php-builder","php-class","php-classes","php-interface","php-library","php-traits"],"created_at":"2024-07-30T20:01:13.505Z","updated_at":"2026-01-16T00:38:33.078Z","avatar_url":"https://github.com/thenlabs.png","language":"PHP","readme":"# ClassBuilder\n\nDynamic management of classes, traits and interfaces in PHP.\n\n\u003eIf you like this project gift us a ⭐.\n\n## Documentation.\n\n1. English (Pending)\n2. [Español](doc/es/index.md)\n\n## Installation.\n\n    $ composer require thenlabs/class-builder\n\n\u003eRequire PHP \u003e= 7.2\n\n## Example.\n\nThe next example shows a way to create dinamically a PHP class using our `ClassBuilder`.\n\n```php\n\u003c?php\n\nuse ThenLabs\\ClassBuilder\\ClassBuilder;\n\n$personClass = new ClassBuilder('Person');\n$personClass-\u003esetNamespace('ThenLabs\\Demo');\n\n$personClass-\u003eaddProperty('name')-\u003esetAccess('protected');\n\n$personClass-\u003eaddMethod('__construct', function (string $name) {\n    $this-\u003ename = $name;\n});\n\n$personClass-\u003eaddMethod('getName', function (): string {\n    return $this-\u003ename;\n});\n\n$personClass-\u003einstall();\n\n$andy = new Person('Andy');\n\n$andy-\u003egetName() === 'Andy';            // true\n$andy instanceof \\ThenLabs\\Demo\\Person; // true\n```\n\n## Development.\n\nClone this repository and install the Composer dependencies.\n\n    $ composer install\n\n### Running the tests.\n\nAll the tests of this project was written with our testing framework [PyramidalTests][pyramidal-tests] wich is based on [PHPUnit][phpunit].\n\nRun tests:\n\n    $ composer test\n\n[phpunit]: https://phpunit.de\n[pyramidal-tests]: https://github.com/thenlabs/pyramidal-tests\n","funding_links":[],"categories":["Web Development"],"sub_categories":["PHP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenlabs%2Fclass-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenlabs%2Fclass-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenlabs%2Fclass-builder/lists"}