Skip to content

Commit

Permalink
Drop workaround around get_class_methods for php < 5.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Feb 5, 2021
1 parent 38ecfea commit 2b847b6
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,12 @@ public function mergeOptions(array $array1, $array2 = null)
/**
* Get class resources (as resource/method pairs)
*
* Uses get_class_methods() by default, reflection on prior to 5.2.6,
* as a bug prevents the usage of get_class_methods() there.
*
* @return array
*/
public function getClassResources()
{
if (null === $this->_classResources) {
if (version_compare(PHP_VERSION, '5.2.6') === -1) {
$class = new ReflectionObject($this);
$classMethods = $class->getMethods();
$methodNames = array();

foreach ($classMethods as $method) {
$methodNames[] = $method->getName();
}
} else {
$methodNames = get_class_methods($this);
}
$methodNames = get_class_methods($this);

$this->_classResources = array();
foreach ($methodNames as $method) {
Expand Down

0 comments on commit 2b847b6

Please sign in to comment.