Reports an Info Issue raised by a Review.

@param  string              $message
@param  ReviewInterface     $review
@param  ReviewableInterface $subject
@return Reporter
964933
public function info($message, ReviewInterface $review, ReviewableInterface $subject)
    {
        $this->report(Issue::LEVEL_INFO, $message, $review, $subject);

        return $this;
    }
885548
public static function log($message, $priority = Project::MSG_INFO)
    {
        $p = self::getCurrentProject();
        if ($p) {
            $p->log($message, $priority);
        }
    }
633305
protected function publishToExchange(Message $message, \AMQPExchange $exchange)
    {
        $isPublished = $exchange->publish(
            $message->getMessage(),
            $message->getRoutingKey(),
            $message->getFlags(),
            $message->getAttributes()
        );

        if (!$isPublished) {
            throw FailedToPublishException::fromMessage($message);
        }

        return $isPublished;
    }
813385
public function review(ReporterInterface $reporter, ReviewableInterface $file)
    {
        $bin = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, 'vendor/bin/phpcs');
        $cmd = $bin . ' --report=json ';

        if ($this->getOptionsForConsole()) {
            $cmd .= $this->getOptionsForConsole();
        }

        $cmd .= $file->getFullPath();

        $process = $this->getProcess($cmd);
        $process->run();

        if (! $process->isSuccessful()) {
            // Create the array of outputs and remove empty values.
            $output = json_decode($process->getOutput(), true);

            $filter = function ($acc, $file) {
                if ($file['errors'] > 0 || $file['warnings'] > 0) {
                    return $acc + $file['messages'];
                }
            };

            foreach (array_reduce($output['files'], $filter, []) as $error) {
                $message = $error['message'] . ' on line ' . $error['line'];
                $reporter->warning($message, $this, $file);
            }
        }
    }
120739
public function addCritical($message, array $context = array())
    {
        return $this->_instance->addRecord(\Monolog\Logger::CRITICAL, $message, $context);
    }
1140110
private function getMessage(string $subject, string $message): \Swift_Message
    {
        $messageObject = new \Swift_Message($subject, $message);
        $messageObject
            ->setFrom([$this->config('mailer.sender_email') => $this->config('mailer.sender_name')])
            ->setTo($this->config('mailer.recipients'))
        ;

        return $messageObject;
    }
774690
public function editMessageAction(Message $message)
    {
        $subject = $message->getSubject();
        $forum = $subject->getCategory()->getForum();
        $isModerator = $this->authorization->isGranted('moderate', new ResourceCollection(array($forum->getResourceNode())));

        if (!$isModerator && $this->tokenStorage->getToken()->getUser() !== $message->getCreator()) {
            throw new AccessDeniedException();
        }

        $oldContent = $message->getContent();
        $form = $this->container->get('form.factory')->create(new MessageType, new Message());
        $form->handleRequest($this->get('request'));

        if ($form->isValid()) {
            $newContent = $form->get('content')->getData();
            $this->manager->editMessage($message, $oldContent, $newContent);

            return new RedirectResponse(
                $this->generateUrl('claro_forum_messages', array('subject' => $subject->getId()))
            );
        }

        return array(
            'subject' => $subject,
            'form' => $form->createView(),
            'message' => $message,
            '_resource' => $forum,
            'workspace' => $forum->getResourceNode()->getWorkspace()
        );
    }
460679
private function handleMessage(HandlerInterface $handler, MessageInterface $message): bool
    {
        // check if handler implements Psr\Log\LoggerAwareInterface (you can use \Psr\Log\LoggerAwareTrait)
        if ($this->logger && method_exists($handler, 'setLogger')) {
            $handler->setLogger($this->logger);
        }

        try {
            $result = $handler->handle($message);

            $this->log(
                LogLevel::INFO,
                "End handle message #{$message->getId()} ({$message->getType()})",
                $this->messageLoggerContext($message)
            );
        } catch (Exception $e) {
            $this->log(
                LogLevel::ERROR,
                "Handler " . get_class($handler) . " throws exception - {$e->getMessage()}",
                ['error' => $e, 'message' => $this->messageLoggerContext($message), 'exception' => $e]
            );
            Debugger::log($e, Debugger::EXCEPTION);
            $result = false;
        }
        return $result;
    }
1023920
public function critical($message, array $context = array())
    {
        // TODO: Implement critical() method.
        return $this->addRecord(\Psr\Log\LogLevel::CRITICAL, $message, $context);
    }
582329
private function checkMessageStatus($message)
    {
        if (!$message || $message->success == 0 || $message->failure > 0) {
            throw new DispatchMessageException(
                sprintf("%d messages could not be processed", $message->failure)
            );
        }
    }
168563
public function message($to = '', $subject = '', $body = '')
    {
        $message = $this->transport->newMessage();

        if ($to) {
            $message->to($to);
        }
        if ($subject) {
            $message->subject($subject);
        }
        if ($body) {
            $message->body($body);
        }

        $message->setMailer($this);

        return $message;
    }
250944
public function get(ContainerInterface $container, $subject = null, $message = null)
    {
        $instance = $container->get($this->component);

        if (empty($this->method)) {
            return $instance;
        }

        $ref = new \ReflectionMethod($instance, $this->method);

        if (empty($this->arguments)) {
            $ref->invoke($instance);

            return $instance;
        }

        $ref->invokeArgs($instance, $this->prepare($container, $this->arguments, $subject, $message));

        return $instance;
    }
1024131
protected function _notFound($id, Subject $subject)
    {
        $subject->set(['success' => false]);
        $this->_trigger('recordNotFound', $subject);

        $message = $this->message('recordNotFound', compact('id'));
        $exceptionClass = $message['class'];
        throw new $exceptionClass($message['text'], $message['code']);
    }
150308
public function update(SubjectInterface $subject)
   {
       if ($subject instanceof ModelInterface) {
           foreach (json_decode(json_encode($subject)) as $key => $value) {
               $this->appendValueTo($this->template, $key, $value);
           }
           return $subject;
       }
   }
1371438
public static function createNewDiscussionReply(ListItem $discussionItem,$subject){
        $ctx = $discussionItem->getContext();
        $list = $discussionItem->getParentList();

        $contentTypes = $list->getContentTypes();
        $ctx->load($contentTypes);
        $ctx->executeQuery();
        $result = $contentTypes->findItems(
            function (ContentType $item){
              return  $item->getProperty("Name") === "Message";
        });
        if(count($result) == 0){
            throw new \Exception("Message content type not found");
        }

        $messagePayload = array(
            "Body" => $subject,
            "FileSystemObjectType" => 0,
            "ContentTypeId" => $result[0]->getProperty("Id")
        );
        $messageItem = $list->addItem($messagePayload);
        $ctx->executeQuery();
        //move message into discussion folder
        $ctx->load($discussionItem,array("FileRef"));
        $ctx->load($messageItem,array("FileRef","FileDirRef"));
        $ctx->executeQuery();
        $sourceFileUrl = $messageItem->getProperty("FileRef");
        $targetFileUrl = str_replace($messageItem->getProperty("FileDirRef"),$discussionItem->getProperty("FileRef"),$sourceFileUrl);
        $ctx->getWeb()->getFileByServerRelativeUrl($sourceFileUrl)->moveTo($targetFileUrl,1);
        $ctx->executeQuery();
        return $messageItem;
    }
1353042
public function message(CommitMessageInterface $message)
    {
        foreach ($this->getReviews()->forMessage($message) as $review) {
            $review->review($this->getReporter(), $message);
        }

        return $this;
    }
529072
public function report(string ...$messages): ResultInterface
    {
        if (! empty($messages)) {
            return ResultFactory::makeFailure(
                $this->checker,
                array_merge([$this->failureMessage], $messages)
            );
        }

        return ResultFactory::makeSuccess($this->checker);
    }