Created
March 15, 2019 20:58
-
-
Save chriscalip/063140aa4b64310d79811af687095b93 to your computer and use it in GitHub Desktop.
PHP: how to get a list of classes that implement certain interface?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$targetMiners = array_values(array_filter(get_declared_classes(), function ($className) { | |
return in_array('App\Contracts\MinerInterface', class_implements($className)); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment