{"id":18929411,"url":"https://github.com/thecodingmachine/class-explorer","last_synced_at":"2025-10-14T09:19:10.914Z","repository":{"id":57067852,"uuid":"146601149","full_name":"thecodingmachine/class-explorer","owner":"thecodingmachine","description":"Find the list of all your PHP classes and more.","archived":false,"fork":false,"pushed_at":"2024-03-11T00:45:03.000Z","size":21,"stargazers_count":12,"open_issues_count":5,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-30T05:47:06.339Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-08-29T13:06:30.000Z","updated_at":"2025-05-09T15:33:05.000Z","dependencies_parsed_at":"2024-06-18T16:53:30.560Z","dependency_job_id":"e558384d-0fa6-4906-8dd0-992c8337aa13","html_url":"https://github.com/thecodingmachine/class-explorer","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.052631578947368474","last_synced_commit":"433e3d058e1c971ee30e2e8b9537b2999fae0876"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/thecodingmachine/class-explorer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fclass-explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fclass-explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fclass-explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fclass-explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/class-explorer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fclass-explorer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018513,"owners_count":26086385,"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-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2024-11-08T11:32:28.535Z","updated_at":"2025-10-14T09:19:10.895Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Class Explorer\n===============\n\n[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/class-explorer/v/stable)](https://packagist.org/packages/thecodingmachine/class-explorer)\n[![Total Downloads](https://poser.pugx.org/thecodingmachine/class-explorer/downloads)](https://packagist.org/packages/thecodingmachine/class-explorer)\n[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/class-explorer/v/unstable)](https://packagist.org/packages/thecodingmachine/class-explorer)\n[![License](https://poser.pugx.org/thecodingmachine/class-explorer/license)](https://packagist.org/packages/thecodingmachine/class-explorer)\n[![Build Status](https://travis-ci.org/thecodingmachine/class-explorer.svg?branch=master)](https://travis-ci.org/thecodingmachine/class-explorer)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/class-explorer/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/thecodingmachine/class-explorer?branch=master)\n\nDiscover PHP classes in your project.\n\nThis project aim is to offer a set of classes enabling classes/interface/trait discovery in your own project.\n\nCurrently, the project contains only one implementation based on scanning files.\n\nGlobClassExplorer\n-----------------\n\nThe `GlobClassExplorer` will look for all classes in a given namespace.\n\n## Usage\n\n```php\n$explorer = new GlobClassExplorer('\\\\Some\\\\Namespace\\\\', $psr16Cache, $cacheTtl);\n$classes = $explorer-\u003egetClasses();\n// Will return: ['Some\\Namespace\\Foo', 'Some\\Namespace\\Bar', ...]\n```\n\nThis explorer:\n\n- looks only for classes in YOUR project (not in the vendor directory)\n- assumes that if a file exists in a PSR-0 or PSR-4 directory, the class is available (assumes the file respects PSR-1)\n- makes no attempt at autoloading the class\n- is pretty fast, even when no cache is involved\n\nBy default, `GlobClassExplorer` will load classes recursively in sub-namespaces. You can prevent it to load classes\nrecursively by passing `false` to the 5th parameter:\n\n```php\n$explorer = new GlobClassExplorer('\\\\This\\\\Namespace\\\\Only\\\\', $psr16Cache, $cacheTtl, null, false);\n```\n\nYou can also get a class map using the `getClassMap` method.\nA class map is an array associating the name of the classes found (in key), to the file they are \nlinked to (the real path of the file).\n\n```php\n$classMap = $explorer-\u003egetClassMap();\nforeach ($classMap as $class =\u003e $file) {\n    echo 'Class '.$class.' found in file '.$file;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fclass-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fclass-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fclass-explorer/lists"}