private function failureException(MethodInvocation $invocation, FailureInterface $failure)
    {
        $class = new \ReflectionClass($invocation->getThis());
        $className = $class->implementsInterface(WeavedInterface::class) ? $class->getParentClass()->name : $class->name;
        $errors = json_encode($failure->getMessages());
        $msg = sprintf('%s::%s() %s', $className, $invocation->getMethod()->name, $errors);

        return new InvalidArgumentException($msg, 400);
    }
private function failureException(MethodInvocation $invocation, FailureInterface $failure)
    {
        $class = new \ReflectionClass($invocation->getThis());
        $className = $class->implementsInterface(WeavedInterface::class) ? $class->getParentClass()->name : $class->name;
        $errors = json_encode($failure->getMessages());
        $msg = sprintf('%s::%s() %s', $className, $invocation->getMethod()->name, $errors);

        return new InvalidArgumentException($msg, 400);
    }
private function failureException ( MethodInvocation $ invocation , FailureInterface $ failure ) { $ class = new \ ReflectionClass ( $ invocation -> getThis ( ) ) ; $ className = $ class -> implementsInterface ( WeavedInterface :: class ) ? $ class -> getParentClass ( ) -> name : $ class -> name ; $ errors = json_encode ( $ failure -> getMessages ( ) ) ; $ msg = sprintf ( '%s::%s() %s' , $ className , $ invocation -> getMethod ( ) -> name , $ errors ) ; return new InvalidArgumentException ( $ msg , 400 ) ; }
Return InvalidArgumentException exception

@param MethodInvocation $invocation
@param FailureInterface $failure

@return InvalidArgumentException
Return InvalidArgumentException exception