{"id":14985349,"url":"https://github.com/composer/class-map-generator","last_synced_at":"2025-12-29T15:25:02.620Z","repository":{"id":37010421,"uuid":"501690074","full_name":"composer/class-map-generator","owner":"composer","description":"Utilities to scan PHP code and generate class maps.","archived":false,"fork":false,"pushed_at":"2025-03-24T16:38:30.000Z","size":698,"stargazers_count":180,"open_issues_count":0,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-03T03:08:06.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/composer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"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,"zenodo":null},"funding":{"custom":"https://packagist.com","tidelift":"packagist/composer/composer","github":"composer"}},"created_at":"2022-06-09T14:37:28.000Z","updated_at":"2025-04-19T03:16:31.000Z","dependencies_parsed_at":"2024-05-02T16:44:15.477Z","dependency_job_id":"267a9bb4-6aea-4bcd-9801-c4ac7c6d16e4","html_url":"https://github.com/composer/class-map-generator","commit_stats":{"total_commits":39,"total_committers":8,"mean_commits":4.875,"dds":"0.17948717948717952","last_synced_commit":"98bbf6780e56e0fd2404fe4b82eb665a0f93b783"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fclass-map-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fclass-map-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fclass-map-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fclass-map-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/composer","download_url":"https://codeload.github.com/composer/class-map-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254047571,"owners_count":22005828,"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":[],"created_at":"2024-09-24T14:10:44.813Z","updated_at":"2025-12-29T15:25:02.615Z","avatar_url":"https://github.com/composer.png","language":"PHP","funding_links":["https://packagist.com","https://tidelift.com/funding/github/packagist/composer/composer","https://github.com/sponsors/composer"],"categories":[],"sub_categories":[],"readme":"composer/class-map-generator\n============================\n\nUtilities to generate class maps and scan PHP code.\n\n[![Continuous Integration](https://github.com/composer/class-map-generator/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/composer/class-map-generator/actions)\n\nInstallation\n------------\n\nInstall the latest version with:\n\n```bash\ncomposer require composer/class-map-generator\n```\n\n\nRequirements\n------------\n\n* PHP 7.2 is required.\n\n\nBasic usage\n-----------\n\nIf all you want is to scan a directory and extract a classmap with all\nclasses/interfaces/traits/enums mapped to their paths, you can simply use:\n\n\n```php\nuse Composer\\ClassMapGenerator\\ClassMapGenerator;\n\n$map = ClassMapGenerator::createMap('path/to/scan');\nforeach ($map as $symbol =\u003e $path) {\n    // do your thing\n}\n```\n\nFor more advanced usage, you can instantiate a generator object and call scanPaths one or more time\nthen call getClassMap to get a ClassMap object containing the resulting map + eventual warnings.\n\n```php\nuse Composer\\ClassMapGenerator\\ClassMapGenerator;\n\n$generator = new ClassMapGenerator;\n$generator-\u003escanPaths('path/to/scan');\n$generator-\u003escanPaths('path/to/scan2');\n\n$classMap = $generator-\u003egetClassMap();\n$classMap-\u003esort(); // optionally sort classes alphabetically\nforeach ($classMap-\u003egetMap() as $symbol =\u003e $path) {\n    // do your thing\n}\n\nforeach ($classMap-\u003egetAmbiguousClasses() as $symbol =\u003e $paths) {\n    // warn user about ambiguous class resolution\n}\n```\n\n\nLicense\n-------\n\ncomposer/class-map-generator is licensed under the MIT License, see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposer%2Fclass-map-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomposer%2Fclass-map-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposer%2Fclass-map-generator/lists"}