From 6deca428d22d7bd0c4171c08fdbfdcd06d94988c Mon Sep 17 00:00:00 2001
From: Ankit Agarwal <ankit@moodle.com>
Date: Mon, 22 Dec 2014 13:37:24 +0530
Subject: [PATCH] MDL-48688 inbound: Fix incorrect class names

---
 admin/tool/messageinbound/classes/manager.php          | 10 +++++-----
 lib/classes/message/inbound/address_manager.php        |  4 ++--
 .../message/inbound/processing_failed_exception.php    |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/admin/tool/messageinbound/classes/manager.php b/admin/tool/messageinbound/classes/manager.php
index 7e1236761aa..9d4668b41fc 100644
--- a/admin/tool/messageinbound/classes/manager.php
+++ b/admin/tool/messageinbound/classes/manager.php
@@ -412,7 +412,7 @@ class manager {
                 mtrace("-- Returning to the original user.");
                 cron_setup_user($originaluser);
                 return;
-            } catch (Exception $e) {
+            } catch (\Exception $e) {
                 // An unknown error occurred. The user is not informed, but the administrator is.
                 mtrace("-- Message processing failed. An unexpected exception was thrown. Details follow.");
                 mtrace($e->getMessage());
@@ -505,8 +505,8 @@ class manager {
     /**
      * Process a message again to add body and attachment data.
      *
-     * @param Horde_Imap_Client_Data_Fetch $basemessagedata The structure and part of the message body
-     * @param string|Horde_Imap_Client_Ids $messageid The Hore message Uid
+     * @param \Horde_Imap_Client_Data_Fetch $basemessagedata The structure and part of the message body
+     * @param string|\Horde_Imap_Client_Ids $messageid The Hore message Uid
      * @return \stdClass The current value of the messagedata
      */
     private function process_message_data_body(
@@ -657,7 +657,7 @@ class manager {
             // Perform a virus scan now.
             try {
                 \repository::antivir_scan_file($filepath, $attachment->filename, true);
-            } catch (moodle_exception $e) {
+            } catch (\moodle_exception $e) {
                 mtrace("--> A virus was found in the attachment '{$attachment->filename}'.");
                 $this->inform_attachment_virus();
                 return;
@@ -807,7 +807,7 @@ class manager {
             $error->message     = $e->getMessage();
             throw new \core\message\inbound\processing_failed_exception('messageprocessingfailed', 'tool_messageinbound', $error);
 
-        } catch (Exception $e) {
+        } catch (\Exception $e) {
             mtrace("-> The Inbound Message handler threw an exception. Unable to process this message. User informed.");
             mtrace("--> " . $e->getMessage());
             // An unknown error occurred. Still inform the user but, this time do not include the specific
diff --git a/lib/classes/message/inbound/address_manager.php b/lib/classes/message/inbound/address_manager.php
index d3d26e26778..ef11300150d 100644
--- a/lib/classes/message/inbound/address_manager.php
+++ b/lib/classes/message/inbound/address_manager.php
@@ -325,8 +325,8 @@ class address_manager {
             if ($content['handlerid1'] > 0 || $content['userid1'] > 0 || $content['datavalue1'] > 0) {
                 // Any 64-bit integer which is greater than the 32-bit integer size will have a non-zero value in the first
                 // half of the integer.
-                throw new moodle_exception('Mixed environment.' +
-                        ' Key generated with a 64-bit machine but received into a 32-bit machine');
+                throw new \moodle_exception('Mixed environment.
+                    Key generated with a 64-bit machine but received into a 32-bit machine.');
             }
             $content['handlerid'] = $content['handlerid2'];
             $content['userid']    = $content['userid2'];
diff --git a/lib/classes/message/inbound/processing_failed_exception.php b/lib/classes/message/inbound/processing_failed_exception.php
index 4c463b5e41a..1e9fbba8220 100644
--- a/lib/classes/message/inbound/processing_failed_exception.php
+++ b/lib/classes/message/inbound/processing_failed_exception.php
@@ -38,7 +38,7 @@ class processing_failed_exception extends \moodle_exception {
      *
      * @param string $identifier The string identifier to use when displaying this exception.
      * @param string $component The string component
-     * @param stdClass $data The data to pass to get_string
+     * @param \stdClass $data The data to pass to get_string
      */
     public function __construct($identifier, $component, \stdClass $data = null) {
         return parent::__construct($identifier, $component, '', $data);