Go\Core\GoAspectContainer::getPointcut PHP Method

getPointcut() public method

Returns a pointcut by identifier
public getPointcut ( string $id ) : Go\Aop\Pointcut
$id string Pointcut identifier
return Go\Aop\Pointcut
    public function getPointcut($id)
    {
        return $this->get("pointcut.{$id}");
    }

Usage Example

 /**
  * Tests that pointcut can be registered and accessed
  */
 public function testPointcutCanBeRegisteredAndReceived()
 {
     $pointcut = $this->getMock(Pointcut::class);
     $this->container->registerPointcut($pointcut, 'test');
     $this->assertSame($pointcut, $this->container->getPointcut('test'));
     // Verify that tag is working
     $pointcuts = $this->container->getByTag('pointcut');
     $this->assertSame(array('pointcut.test' => $pointcut), $pointcuts);
 }