{"id":20180558,"url":"https://github.com/ergebnis/classy","last_synced_at":"2025-04-05T03:12:07.732Z","repository":{"id":25700214,"uuid":"105255044","full_name":"ergebnis/classy","owner":"ergebnis","description":"🔍 Provides a composer package with a finder for classy constructs (classes, enums, interfaces, and traits).","archived":false,"fork":false,"pushed_at":"2024-10-23T15:05:00.000Z","size":3877,"stargazers_count":33,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-23T18:58:30.932Z","etag":null,"topics":["classes","classy","constructs","enums","finder","interfaces","traits"],"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/ergebnis.png","metadata":{"funding":{"github":["ergebnis","localheinz"]},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-29T09:28:29.000Z","updated_at":"2024-10-23T15:05:03.000Z","dependencies_parsed_at":"2024-02-05T16:44:02.618Z","dependency_job_id":"ec207233-231b-4464-8b32-b711e3dceb38","html_url":"https://github.com/ergebnis/classy","commit_stats":{"total_commits":877,"total_committers":5,"mean_commits":175.4,"dds":0.4389965792474344,"last_synced_commit":"be07448826e4fdeb64fc2e4aacae5ad7d4a4e041"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fclassy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fclassy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fclassy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fclassy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ergebnis","download_url":"https://codeload.github.com/ergebnis/classy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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":["classes","classy","constructs","enums","finder","interfaces","traits"],"created_at":"2024-11-14T02:31:43.395Z","updated_at":"2025-04-05T03:12:07.709Z","avatar_url":"https://github.com/ergebnis.png","language":"PHP","readme":"# classy\n\n[![Integrate](https://github.com/ergebnis/classy/workflows/Integrate/badge.svg)](https://github.com/ergebnis/classy/actions)\n[![Merge](https://github.com/ergebnis/classy/workflows/Merge/badge.svg)](https://github.com/ergebnis/classy/actions)\n[![Release](https://github.com/ergebnis/classy/workflows/Release/badge.svg)](https://github.com/ergebnis/classy/actions)\n[![Renew](https://github.com/ergebnis/classy/workflows/Renew/badge.svg)](https://github.com/ergebnis/classy/actions)\n\n[![Code Coverage](https://codecov.io/gh/ergebnis/classy/branch/main/graph/badge.svg)](https://codecov.io/gh/ergebnis/classy)\n\n[![Latest Stable Version](https://poser.pugx.org/ergebnis/classy/v/stable)](https://packagist.org/packages/ergebnis/classy)\n[![Total Downloads](https://poser.pugx.org/ergebnis/classy/downloads)](https://packagist.org/packages/ergebnis/classy)\n[![Monthly Downloads](http://poser.pugx.org/ergebnis/classy/d/monthly)](https://packagist.org/packages/ergebnis/classy)\n\nThis project provides a [`composer`](https://getcomposer.org) package with a finder for classy constructs ([classes](https://www.php.net/manual/en/language.oop5.php), [enums](https://www.php.net/manual/en/language.types.enumerations.php), [interfaces](https://www.php.net/manual/en/language.oop5.interfaces.php), and [traits](https://www.php.net/manual/en/language.oop5.traits.php)).\n\n## Installation\n\nRun\n\n```sh\ncomposer require ergebnis/classy\n```\n\n## Usage\n\n### Collect classy constructs from source code\n\nUse `Classy\\Constructs::fromSource()` to collect classy constructs in source code:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Classy;\n\n$source = \u003c\u003c\u003c'PHP'\n\u003c?php\n\nnamespace Example;\n\nclass Foo {}\n\nenum Bar {}\n\ninterface Baz {}\n\ntrait Qux {}\nPHP;\n\n$constructs = Classy\\Constructs::fromSource($source);\n\n$names = array_map(static function (Classy\\Construct $construct): string {\n    return $construct-\u003ename();\n}, $constructs);\n\nvar_dump($names); // ['Example\\Bar', 'Example\\Baz', 'Example\\Foo', 'Example\\Qux']\n```\n\n### Collect classy constructs from a directory\n\nUse `Classy\\Constructs::fromDirectory()` to collect classy constructs in a directory:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Classy;\n\n$constructs = Classy\\Constructs::fromDirectory(__DIR__ . '/example');\n\n$names = array_map(static function (Classy\\Construct $construct): string {\n    return $construct-\u003ename();\n}, $constructs);\n\nvar_dump($names); // ['Example\\Bar', 'Example\\Bar\\Baz', 'Example\\Foo\\Bar\\Baz']\n```\n\n## Changelog\n\nThe maintainers of this project record notable changes to this project in a [changelog](CHANGELOG.md).\n\n## Contributing\n\nThe maintainers of this project suggest following the [contribution guide](.github/CONTRIBUTING.md).\n\n## Code of Conduct\n\nThe maintainers of this project ask contributors to follow the [code of conduct](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).\n\n## General Support Policy\n\nThe maintainers of this project provide limited support.\n\nYou can support the maintenance of this project by [sponsoring @localheinz](https://github.com/sponsors/localheinz) or [requesting an invoice for services related to this project](mailto:am@localheinz.com?subject=ergebnis/classy:%20Requesting%20invoice%20for%20services).\n\n## PHP Version Support Policy\n\nThis project supports PHP versions with [active and security support](https://www.php.net/supported-versions.php).\n\nThe maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support.\n\n## Security Policy\n\nThis project has a [security policy](.github/SECURITY.md).\n\n## License\n\nThis project uses the [MIT license](LICENSE.md).\n\n## Credits\n\nThe algorithm for finding classes in PHP files in [`Constructs`](src/Constructs.php) has been adopted from [`Zend\\File\\ClassFileLocator`](https://github.com/zendframework/zend-file/blob/release-2.7.1/src/ClassFileLocator.php) (originally licensed under BSD-3-Clause).\n\n## Social\n\nFollow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.\n","funding_links":["https://github.com/sponsors/ergebnis","https://github.com/sponsors/localheinz"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fclassy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fergebnis%2Fclassy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fclassy/lists"}