Bug #2683

Advice can only be declared on public methods

Added by Bastian Waidelich over 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-02-23
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:AOP
Target version:-
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

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

Associated revisions

Revision 848b6361
Added by Karsten Dambekalns over 6 years ago

FLOW3:
  • fixed use of get_class_methods in reflection service and proxy class builder, fixes #2683
  • made Router.findMatchResults() protected (was blocked by #2683)

History

#1 Updated by Karsten Dambekalns over 6 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
  • Assigned To changed from Robert Lemke to Karsten Dambekalns

#2 Updated by Karsten Dambekalns over 6 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 6 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 6 years ago

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

Applied in changeset r1954.

Also available in: Atom PDF