12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
-
-
-
- namespace JMS\AopBundle\Aop;
-
-
- class RegexPointcut implements PointcutInterface
- {
- private $pattern;
-
- public function __construct($pattern)
- {
- $this->pattern = $pattern;
- }
-
- public function matchesClass(\ReflectionClass $class)
- {
- return true;
- }
-
- public function matchesMethod(\ReflectionMethod $method)
- {
- return 0 < preg_match('#'.$this->pattern.'#', sprintf('%s::%s', $method->class, $method->name));
- }
- }
|