-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathWeavingAspect.php
33 lines (28 loc) · 938 Bytes
/
WeavingAspect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace Go\Tests\TestProject\Aspect;
use Go\Aop\Aspect;
use Go\Lang\Attribute as Pointcut;
class WeavingAspect implements Aspect
{
/**
* Intercepts method in the final class
*/
#[Pointcut\After("execution(public Go\Tests\TestProject\Application\FinalClass->*(*))")]
public function afterPublicMethodInTheFinalClass()
{
echo 'It intercepts methods in the final class';
}
/**
* Doesn't intercept interfaces
*/
#[Pointcut\After("execution(public Go\Tests\TestProject\Application\FooInterface->*(*))")]
public function afterPublicMethodInTheInterface()
{
echo 'It does not intercept methods in the interface';
}
#[Pointcut\After("within(Go\Tests\TestProject\Application\ClassWithComplexTypes) && execution(public **->*(*))")]
public function afterComplexTypeMethods(): void
{
echo 'It intercepts methods with complex types';
}
}