Neos\Flow\Aop\JoinPointInterface::isMethodArgument PHP Method

isMethodArgument() public method

Returns TRUE if the argument with the specified name exists in the method call this joinpoint refers to.
public isMethodArgument ( string $argumentName ) : boolean
$argumentName string Name of the argument to check
return boolean TRUE if the argument exists
    public function isMethodArgument($argumentName);

Usage Example

 /**
  * Logs calls of destroy()
  *
  * @Flow\Before("within(Neos\Flow\Session\SessionInterface) && method(.*->destroy())")
  * @param JoinPointInterface $joinPoint The current joinpoint
  * @return mixed The result of the target method if it has not been intercepted
  */
 public function logDestroy(JoinPointInterface $joinPoint)
 {
     $session = $joinPoint->getProxy();
     if ($session->isStarted()) {
         $reason = $joinPoint->isMethodArgument('reason') ? $joinPoint->getMethodArgument('reason') : 'no reason given';
         $this->systemLogger->log(sprintf('%s: Destroyed session with id %s: %s', $this->getClassName($joinPoint), $joinPoint->getProxy()->getId(), $reason), LOG_INFO);
     }
 }