0

I use get_class_methods to get classes for Drupal classes, for example I go to devel/php and run:

$coupon = \Drupal::entityTypeManager()
  ->getStorage('commerce_promotion_coupon')->load(3);

ksm(get_class_methods($coupon));`

But If I want to get list of classes for some vendor library I don't know how to get them.

1 Answer 1

1

That's off-topic. But try this:

$ composer require ramsey/uuid

And then put the whole use statement without use into get_class_methods():

ksm(get_class_methods('Ramsey\Uuid\Uuid'));

Putting that into a new ReflectionClass() would actually give you much more useful output:

$class = new ReflectionClass('Ramsey\Uuid\Uuid');
$methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
ksm($methods);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.