Completed
Push — master ( b11ab5...575823 )
by Stefano
11:07
created
Plugins/ActualOutsideTemperature_plugin/ActualOutsideTemperature_plugin.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\ActualOutsideTemperature_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8 7
 use JarvisPHP\Core\JarvisTTS;
Please login to merge, or discard this patch.
Plugins/Gcalendar_plugin/Gcalendar_plugin.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\Gcalendar_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8 7
 use JarvisPHP\Core\JarvisTTS;
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 define('CREDENTIALS_PATH', 'Plugins/Gcalendar_plugin/api-key.json');
12 12
 define('CLIENT_SECRET_PATH', 'Plugins/Gcalendar_plugin/secret-client-key.json');
13 13
 define('SCOPES', implode(' ', array(
14
-  \Google_Service_Calendar::CALENDAR_READONLY)
14
+    \Google_Service_Calendar::CALENDAR_READONLY)
15 15
 ));
16 16
 define('_MAX_EVENTS', 4);
17 17
 
@@ -46,26 +46,26 @@  discard block
 block discarded – undo
46 46
         // Print the next _MAX_EVENTS events on the user's calendar.
47 47
         $calendarId = 'primary';
48 48
         $optParams = array(
49
-          'maxResults' => _MAX_EVENTS,
50
-          'orderBy' => 'startTime',
51
-          'singleEvents' => TRUE,
52
-          'timeMin' => date('c'),
49
+            'maxResults' => _MAX_EVENTS,
50
+            'orderBy' => 'startTime',
51
+            'singleEvents' => TRUE,
52
+            'timeMin' => date('c'),
53 53
         );
54 54
         $results = $service->events->listEvents($calendarId, $optParams);
55 55
 
56 56
         if (count($results->getItems()) == 0) {
57
-          $answer = JarvisLanguage::translate('no_appointments',get_called_class());
57
+            $answer = JarvisLanguage::translate('no_appointments',get_called_class());
58 58
         } else {
59 59
           
60
-          foreach ($results->getItems() as $event) {
60
+            foreach ($results->getItems() as $event) {
61 61
             $start = $event->start->dateTime;
62 62
             if (empty($start)) {
63
-              $start = $event->start->date;
63
+                $start = $event->start->date;
64 64
             }
65 65
 
66 66
             $date = new \DateTime($start);
67 67
             $answer.= sprintf(JarvisLanguage::translate('list_events',get_called_class()), $date->format('j'), JarvisLanguage::translate('month_'.$date->format('n'),get_called_class()), $date->format('H'), $date->format('i'), $event->getSummary())."\n";
68
-          }
68
+            }
69 69
         }
70 70
 
71 71
         JarvisTTS::speak($answer);
@@ -102,27 +102,27 @@  discard block
 block discarded – undo
102 102
      * @return Google_Client the authorized client object
103 103
      */
104 104
     function getClient() {
105
-      $client = new \Google_Client();
106
-      $client->setApplicationName(APPLICATION_NAME);
107
-      $client->setScopes(SCOPES);
108
-      $client->setAuthConfigFile(CLIENT_SECRET_PATH);
109
-      $client->setAccessType('offline');
105
+        $client = new \Google_Client();
106
+        $client->setApplicationName(APPLICATION_NAME);
107
+        $client->setScopes(SCOPES);
108
+        $client->setAuthConfigFile(CLIENT_SECRET_PATH);
109
+        $client->setAccessType('offline');
110 110
 
111
-      // Load previously authorized credentials from a file.
112
-      $credentialsPath = CREDENTIALS_PATH;
113
-      if (file_exists($credentialsPath)) {
111
+        // Load previously authorized credentials from a file.
112
+        $credentialsPath = CREDENTIALS_PATH;
113
+        if (file_exists($credentialsPath)) {
114 114
         $accessToken = file_get_contents($credentialsPath);
115
-      } else {
115
+        } else {
116 116
         return null;
117
-      }
118
-      $client->setAccessToken($accessToken);
117
+        }
118
+        $client->setAccessToken($accessToken);
119 119
 
120
-      // Refresh the token if it's expired.
121
-      if ($client->isAccessTokenExpired()) {
120
+        // Refresh the token if it's expired.
121
+        if ($client->isAccessTokenExpired()) {
122 122
         $client->refreshToken($client->getRefreshToken());
123 123
         file_put_contents($credentialsPath, $client->getAccessToken());
124
-      }
125
-      return $client;
124
+        }
125
+        return $client;
126 126
     }
127 127
 
128 128
 }
Please login to merge, or discard this patch.
Plugins/Hello_plugin/Hello_plugin.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\Hello_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8 7
 use JarvisPHP\Core\JarvisTTS;
Please login to merge, or discard this patch.
Plugins/InformationOn_plugin/InformationOn_plugin.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\InformationOn_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8 7
 use JarvisPHP\Core\JarvisTTS;
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
         //Extract search term
29 29
         preg_match(JarvisLanguage::translate('preg_match_activate_plugin',get_called_class()), $command, $matches);
30 30
         $search_term = $matches[2];
31
-		$wiki_query_url = _WIKI_URL . "?action=opensearch&search=" . urlencode($search_term) . "&format=xml&limit=5";
32
-		$xml = simplexml_load_string(file_get_contents($wiki_query_url));
31
+        $wiki_query_url = _WIKI_URL . "?action=opensearch&search=" . urlencode($search_term) . "&format=xml&limit=5";
32
+        $xml = simplexml_load_string(file_get_contents($wiki_query_url));
33 33
         $item_array = $xml->Section->Item;
34 34
         $answer = JarvisLanguage::translate('nothing_found',get_called_class());
35 35
         //Have i got results?
Please login to merge, or discard this patch.
Plugins/Movie_plugin/Movie_plugin.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\Movie_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8 7
 use JarvisPHP\Core\JarvisTTS;
Please login to merge, or discard this patch.
Plugins/Radio_plugin/Radio_plugin.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\Radio_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8
-use JarvisPHP\Core\JarvisTTS;
9 7
 
10 8
 /**
11 9
  * Radio_plugin
Please login to merge, or discard this patch.
Plugins/RaspPIVolume_plugin/RaspPIVolume_plugin.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\RaspPIVolume_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8
-use JarvisPHP\Core\JarvisTTS;
9 7
 
10 8
 /**
11 9
  * RaspberryPI Volume Control Plugin
Please login to merge, or discard this patch.
Plugins/Weather_plugin/Weather_plugin.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\Weather_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8 7
 use JarvisPHP\Core\JarvisTTS;
Please login to merge, or discard this patch.
Plugins/Wemo_plugin/Wemo_plugin.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace JarvisPHP\Plugins\Wemo_plugin;
4 4
 
5
-use JarvisPHP\Core\JarvisSession;
6 5
 use JarvisPHP\Core\JarvisPHP;
7 6
 use JarvisPHP\Core\JarvisLanguage;
8 7
 use JarvisPHP\Core\JarvisTTS;
Please login to merge, or discard this patch.