New functionality
Added:
AllPublicMethods attribute when used as class attribute it takes all public methods to intercept except __constructor
Codecov Report
Merging #191 (d0758bf) into 2.x (bb0e70d) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## 2.x #191 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 171 181 +10
===========================================
Files 29 30 +1
Lines 507 521 +14
===========================================
+ Hits 507 521 +14
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/Annotation/AllPublicMethods.php | 100.00% <100.00%> (ø) |
|
| src/Bind.php | 100.00% <100.00%> (ø) |
|
| src/MethodMatch.php | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
@edsonlsjj I think it is a good idea to match only public methods. But then why not just create that matcher?
$pointcut = new Pointcut(
(new Matcher())->any(), // any class
(new Matcher())->isPublic(), // public method exclude PHP built-in method
[new WeekendBlocker()]
);
(Sorry for the late reply!)
@edsonlsjj I have reconsidered. This can be handled without code changes, just a combination of existing matches.
$mather = new Matcher();
$pointcut = new Pointcut(
$mather->any(), // any class
$mather->logicalNot(
$mather->startsWith('__')
),
[new WeekendBlocker()]
);
@edsonlsjj If you still have questions, feel free to re-open it!







