{"id":15026135,"url":"https://github.com/wyrihaximus/php-list-classes-in-directory","last_synced_at":"2025-04-06T22:09:51.067Z","repository":{"id":33136379,"uuid":"152880942","full_name":"WyriHaximus/php-list-classes-in-directory","owner":"WyriHaximus","description":"Allows you to list full qualified class names in directories and files.","archived":false,"fork":false,"pushed_at":"2024-11-06T16:11:35.000Z","size":341,"stargazers_count":24,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T22:09:41.040Z","etag":null,"topics":["hacktoberfest","php","php7","php72"],"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/WyriHaximus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"WyriHaximus"}},"created_at":"2018-10-13T14:37:02.000Z","updated_at":"2024-08-08T08:15:24.000Z","dependencies_parsed_at":"2025-01-07T04:33:21.113Z","dependency_job_id":null,"html_url":"https://github.com/WyriHaximus/php-list-classes-in-directory","commit_stats":{"total_commits":86,"total_committers":7,"mean_commits":"12.285714285714286","dds":0.627906976744186,"last_synced_commit":"3c9f96fe973a47a917830dd926a7153e5bb8338f"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Fphp-list-classes-in-directory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Fphp-list-classes-in-directory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Fphp-list-classes-in-directory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximus%2Fphp-list-classes-in-directory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WyriHaximus","download_url":"https://codeload.github.com/WyriHaximus/php-list-classes-in-directory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["hacktoberfest","php","php7","php72"],"created_at":"2024-09-24T20:03:51.644Z","updated_at":"2025-04-06T22:09:51.016Z","avatar_url":"https://github.com/WyriHaximus.png","language":"PHP","funding_links":["https://github.com/sponsors/WyriHaximus"],"categories":[],"sub_categories":[],"readme":"# List all PHP classes in directories and files\n\n[![Continuous Integration](https://github.com/WyriHaximus/php-list-classes-in-directory/actions/workflows/ci.yml/badge.svg)](https://github.com/WyriHaximus/php-list-classes-in-directory/actions/workflows/ci.yml)\n[![Latest Stable Version](https://poser.pugx.org/wyrihaximus/list-classes-in-directory/v/stable.png)](https://packagist.org/packages/wyrihaximus/list-classes-in-directory)\n[![Total Downloads](https://poser.pugx.org/wyrihaximus/list-classes-in-directory/downloads.png)](https://packagist.org/packages/wyrihaximus/list-classes-in-directory/stats)\n[![Code Coverage](https://scrutinizer-ci.com/g/wyrihaximus/php-list-classes-in-directory/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wyrihaximus/php-list-classes-in-directory/?branch=master)\n[![License](https://poser.pugx.org/wyrihaximus/list-classes-in-directory/license.png)](https://packagist.org/packages/wyrihaximus/list-classes-in-directory)\n\n\n# Install\n\nTo install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.\n\n```\ncomposer require wyrihaximus/list-classes-in-directory\n```\n\n# Usage\n\n#### get a list of classes from multiple directories.\n\n```php\nuse function WyriHaximus\\Lister;\n\n// $classes now contains a list of full qualified class names from 'src/' and 'tests/'\n$classes = Lister::classesInDirectories(\n    __DIR__ . '/src',\n    __DIR__ . '/tests'\n);\n\n\n// use listInstantiatableClassesInDirectories() or listNonInstantiatableClassesInDirectories() to only consider classes that can actually be instantiated, or not.\n$instantiatableClasses = Lister::instantiatableClassesInDirectory(\n    __DIR__ . '/src',\n    __DIR__ . '/tests'\n);\n$nonInstantiatableClasses = Lister::nonInstantiatableClassesInDirectory(\n    __DIR__ . '/src',\n    __DIR__ . '/tests'\n);\n```\n\n#### get a list of classes from one directory.\n```php\nuse function WyriHaximus\\Lister;\n\n// $classes now contains a list of full qualified class names from __DIR__\n$classes = Lister::classesInDirectory(__DIR__);\n\n// use listInstantiatableClassesInDirectory() or listNonInstantiatableClassesInDirectory() to only consider classes that can actually be instantiated, or not.\n$instantiatableClasses = Lister::instantiatableClassesInDirectory(__DIR__);\n$nonInstantiatableClasses = Lister::nonInstantiatableClassesInDirectory(__DIR__);\n\n```\n\n#### get a list of classes from multiple files.\n```php\nuse function WyriHaximus\\Lister;\n\n// $classes now contains a list of full qualified class names from 'Bar.php' and 'Foo.php'\n$classes = Lister::classesInFiles(\n    __DIR__ . '/Bar.php',\n    __DIR__ . '/Foo.php'\n);\n```\n\n#### get a list of classes from one file.\n```php\nuse function WyriHaximus\\Lister;\n\n// $classes now contains a list of full qualified class names from 'Foo.php'\n$classes = Lister::classesInFile(__DIR__.'/Foo.php');\n```\n\n# Acknowledgement\n\nThis package is a shorthand function for using [`better reflection`](https://github.com/Roave/BetterReflection/) and is based on one of the [`examples`](https://github.com/Roave/BetterReflection/blob/396a07c9d276cb9ffba581b24b2dadbb542d542e/demo/parsing-whole-directory/example2.php).\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2024 Cees-Jan Kiewiet\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyrihaximus%2Fphp-list-classes-in-directory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyrihaximus%2Fphp-list-classes-in-directory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyrihaximus%2Fphp-list-classes-in-directory/lists"}