Bug #2683

Advice can only be declared on public methods

Added by Bastian Waidelich over 12 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Should have
Category:
AOP
Target version:
-
Start date:
2009-02-23
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

Advice can only be declared on public methods. This should work for protected methods, too.

#1

Updated by Karsten Dambekalns over 12 years ago

  • Subject changed from "methodTaggedWith" only matches public methods to Advice can only be declared on public methods
  • Status changed from New to Accepted
  • Assignee changed from Robert Lemke to Karsten Dambekalns
#2

Updated by Karsten Dambekalns over 12 years ago

This is caused by "unexpected" behaviour of PHP. get_class_methods() returns only names of public methods, but is used to fetch the available methods. This is the case also in the Reflection\Service.

#3

Updated by Bastian Waidelich over 12 years ago

It seems, you gotta use \ReflectionClass in order to fetch private and protected methods of a class.

#4

Updated by Karsten Dambekalns over 12 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r1954.

Also available in: Atom PDF