Last active
October 13, 2015 06:58
-
-
Save masihyeganeh/4156943 to your computer and use it in GitHub Desktop.
Snippet to get Only derived class's methods list
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 | |
/** | |
* Gets public methods name of a class only defined in that class, | |
* not it's parent | |
* | |
* @param string $className Name of the class. | |
* | |
* @return array Returns list of methods. | |
*/ | |
function getDerivedClassOnlyMethods($className) | |
{ | |
return array_diff ( | |
get_class_methods($className), | |
get_class_methods(get_parent_class($className)) | |
); | |
} | |
$Derived_Class_Only_Methods_Name_List = getDerivedClassOnlyMethods('Class Name'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment