{"id":19836058,"url":"https://github.com/alekitto/class-finder","last_synced_at":"2025-05-01T18:30:21.197Z","repository":{"id":57005118,"uuid":"116609623","full_name":"alekitto/class-finder","owner":"alekitto","description":"Utility classes to help discover other classes/namespaces","archived":false,"fork":false,"pushed_at":"2025-02-20T21:21:14.000Z","size":391,"stargazers_count":29,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T13:18:43.309Z","etag":null,"topics":["class-discovery","class-finder","namespaces-php"],"latest_commit_sha":null,"homepage":"https://alekitto.github.io/class-finder/","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/alekitto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["alekitto"]}},"created_at":"2018-01-08T00:17:04.000Z","updated_at":"2025-02-23T05:08:18.000Z","dependencies_parsed_at":"2024-02-07T10:48:37.920Z","dependency_job_id":"6c49e06b-f30a-4609-b4bf-4b4615e08869","html_url":"https://github.com/alekitto/class-finder","commit_stats":{"total_commits":49,"total_committers":4,"mean_commits":12.25,"dds":"0.12244897959183676","last_synced_commit":"053c95c372c488925848e6a56f13b84f4fa6f198"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fclass-finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fclass-finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fclass-finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fclass-finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alekitto","download_url":"https://codeload.github.com/alekitto/class-finder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924542,"owners_count":21665987,"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":["class-discovery","class-finder","namespaces-php"],"created_at":"2024-11-12T12:09:55.187Z","updated_at":"2025-05-01T18:30:20.412Z","avatar_url":"https://github.com/alekitto.png","language":"PHP","funding_links":["https://github.com/sponsors/alekitto"],"categories":[],"sub_categories":[],"readme":"# ClassFinder\n\nUtility classes to help discover other classes/namespaces\n\n![Tests](https://github.com/alekitto/class-finder/workflows/Tests/badge.svg)\n[![codecov](https://codecov.io/gh/alekitto/class-finder/branch/master/graph/badge.svg)](https://codecov.io/gh/alekitto/class-finder)\n\n---\n\n## Installation\n\n```bash\n$ composer require kcs/class-finder\n```\n\n## Usage\n\nFinder helps you to discover classes into your project.\n\nThe most common way to discover is to use the provided `ComposerFinder`.\nThis will search for classes using the auto-generated class loader\nfrom composer and resolving PSR-* namespaces accordingly.\n\nRead more in the docs at [https://alekitto.github.io/class-finder/](https://alekitto.github.io/class-finder/)\n\n### Basic usage\n\n```php\nuse Kcs\\ClassFinder\\Finder\\ComposerFinder;\n\n$finder = new ComposerFinder();\nforeach ($finder as $className =\u003e $reflector) {\n    // Do magic things...\n}\n```\n\n### Filtering\n\nYou can filter classes using the methods exposed by `FinderInterface`:\n\n- `implementationOf(array $interfaces)`: Finds the classes that implements \n  all the given interfaces. You can pass a single interface as string.\n- `subclassOf(string $superClass)`: Finds all the classes that are subclasses\n  of the given class.\n- `annontatedBy(string $annotationClass)`: Finds all the classes that have\n  the given annotation in the class docblock.\n- `withAttribute(string $attributeClass)`: Finds all the classes that have\n  the given attribute applied on the class (PHP \u003e= 8.0) only.\n- `in(array $dirs)`: Searches only in given directories.\n- `inNamespace(array $namespaces)`: Searches only in given namespaces.\n- `filter(callable $callback)`: Custom filtering callback.\n- `pathFilter(callable $callback)`: Custom filtering callback for loading files.\n\n\n## License\n\nThis library is released under the MIT license.\n\n## Contributions\n\nContributions are always welcome.\nPlease feel free to open a PR or file an issue.\n\n---\n\nThank you for reading  \nA.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekitto%2Fclass-finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falekitto%2Fclass-finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekitto%2Fclass-finder/lists"}