Completed
Branch master (6ed6e7)
by Lars
07:57
created
src/Intraface/XMLRPC/CMS/Server.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@
 block discarded – undo
12 12
     private $credentials;
13 13
     private $kernel;
14 14
 
15
+    /**
16
+     * @param integer $site_id
17
+     */
15 18
     private function factory($site_id)
16 19
     {
17 20
         if (!$this->kernel->weblogin->hasModuleAccess('cms')) { // -2
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -150,13 +150,13 @@
 block discarded – undo
150 150
             throw new XML_RPC2_FaultException('Wrong parameters. You need to specify the private key.', -5);
151 151
         }
152 152
 
153
-		$auth_adapter = new Intraface_Auth_PrivateKeyLogin(MDB2::singleton(DB_DSN), $credentials['session_id'], $credentials['private_key']);
154
-		$weblogin = $auth_adapter->auth();
153
+        $auth_adapter = new Intraface_Auth_PrivateKeyLogin(MDB2::singleton(DB_DSN), $credentials['session_id'], $credentials['private_key']);
154
+        $weblogin = $auth_adapter->auth();
155 155
 
156
-		if (!$weblogin) {
157
-		    require_once 'XML/RPC2/Exception.php';
156
+        if (!$weblogin) {
157
+            require_once 'XML/RPC2/Exception.php';
158 158
             throw new XML_RPC2_FaultException('Access to the intranet denied. The private key is probably wrong.', -5);
159
-		}
159
+        }
160 160
 
161 161
         $this->kernel = new Intraface_Kernel();
162 162
         $this->kernel->weblogin = $weblogin;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
              * niveau 9999 g�r at den ikke kan genkende den, og tager top_level.
70 70
              * 0 der ellers skulle v�re topmenu virker af en m�rkelig grund ikke. Variablen er ikke registeret som sat!
71 71
              */
72
-            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array');	// 'toplevel'
72
+            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
73 73
             $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
74 74
             $cmspage->value['sections'] = $cmspage->collect();
75 75
             $cmspage->value['comments'] = $cmspage->getComments();
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/CMS/Server0300.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -9,6 +9,9 @@
 block discarded – undo
9 9
  */
10 10
 class Intraface_XMLRPC_CMS_Server0300 extends Intraface_XMLRPC_Server
11 11
 {
12
+    /**
13
+     * @param integer $site_id
14
+     */
12 15
     private function factory($site_id)
13 16
     {
14 17
         if (!$this->kernel->weblogin->hasModuleAccess('cms')) { // -2
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             // niveau 9999 g�r at den ikke kan genkende den, og tager top_level.
69 69
             // 0 der ellers skulle v�re topmenu virker af en m�rkelig grund ikke. Variablen er ikke registeret som sat!
70 70
             //
71
-            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array');	// 'toplevel'
71
+            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
72 72
             $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
73 73
             $cmspage->value['sections'] = $cmspage->collect();
74 74
             $cmspage->value['comments'] = $cmspage->getComments();
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $this->factory($site_id);
153 153
 
154 154
         $cmspage = new CMS_Page($this->site);
155
-        $value['toplevel'] = $cmspage->navigation->build(9999, 'array');    // 'toplevel'
155
+        $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
156 156
         $value['sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
157 157
 
158 158
         return $this->prepareResponseData($value);
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/CMS/Server0400.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -9,6 +9,9 @@
 block discarded – undo
9 9
  */
10 10
 class Intraface_XMLRPC_CMS_Server0300 extends Intraface_XMLRPC_Server0100
11 11
 {
12
+    /**
13
+     * @param integer $site_id
14
+     */
12 15
     private function factory($site_id)
13 16
     {
14 17
         if (!$this->kernel->weblogin->hasModuleAccess('cms')) { // -2
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             // level 9999 cannot be recognized, so we take top level
64 64
             // 0 which should be top level does not work - the variable is not set
65 65
 
66
-            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array');	// 'toplevel'
66
+            $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
67 67
             $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
68 68
             $cmspage->value['sections'] = $cmspage->collect();
69 69
             $cmspage->value['comments'] = $cmspage->getComments();
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $this->factory($site_id);
146 146
 
147 147
         $cmspage = new CMS_Page($this->site);
148
-        $value['toplevel'] = $cmspage->navigation->build(9999, 'array');    // 'toplevel'
148
+        $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel'
149 149
         $value['sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel'
150 150
 
151 151
         return $this->prepareResponseData($value);
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Contact/Server.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -263,7 +263,7 @@
 block discarded – undo
263 263
      * Checking credentials
264 264
      *
265 265
      * @param struct $credentials
266
-     * @return array
266
+     * @return boolean
267 267
      */
268 268
     protected function checkCredentials($credentials)
269 269
     {
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -280,13 +280,13 @@
 block discarded – undo
280 280
             throw new XML_RPC2_FaultException('supply a session_id', -5);
281 281
         }
282 282
 
283
-		$auth_adapter = new Intraface_Auth_PrivateKeyLogin(MDB2::singleton(DB_DSN), $credentials['session_id'], $credentials['private_key']);
284
-		$weblogin = $auth_adapter->auth();
283
+        $auth_adapter = new Intraface_Auth_PrivateKeyLogin(MDB2::singleton(DB_DSN), $credentials['session_id'], $credentials['private_key']);
284
+        $weblogin = $auth_adapter->auth();
285 285
 
286
-		if (!$weblogin) {
287
-		    require_once 'XML/RPC2/Exception.php';
286
+        if (!$weblogin) {
287
+            require_once 'XML/RPC2/Exception.php';
288 288
             throw new XML_RPC2_FaultException('Access to the intranet denied. The private key is probably wrong.', -5);
289
-		}
289
+        }
290 290
 
291 291
         $this->kernel = new Intraface_Kernel();
292 292
         $this->kernel->intranet = new Intraface_Intranet($weblogin->getActiveIntranetId());
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@
 block discarded – undo
269 269
     {
270 270
         if (count($credentials) != 2) { // -4
271 271
             require_once 'XML/RPC2/Exception.php';
272
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
272
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
273 273
         }
274 274
         if (empty($credentials['private_key'])) { // -5
275 275
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Controller/Server.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -26,6 +26,9 @@  discard block
 block discarded – undo
26 26
         return parent::dispatch();
27 27
     }
28 28
 
29
+    /**
30
+     * @param string $backend
31
+     */
29 32
     function setBackend($backend)
30 33
     {
31 34
         if ($backend == 'xmlrpcext') {
@@ -74,6 +77,9 @@  discard block
 block discarded – undo
74 77
         return $backend;
75 78
     }
76 79
 
80
+    /**
81
+     * @return string
82
+     */
77 83
     function getEncoding()
78 84
     {
79 85
         return $this->encoding = $this->backends[$this->getBackend()];
@@ -122,6 +128,9 @@  discard block
 block discarded – undo
122 128
         return ($this->backend == 'xmlrpcext');
123 129
     }
124 130
 
131
+    /**
132
+     * @return string
133
+     */
125 134
     function getResponse()
126 135
     {
127 136
         if ($this->isXmlRpcExt()) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
         }
87 87
 
88 88
         $options = array(
89
-            'prefix' => $this->prefix . '.',
89
+            'prefix' => $this->prefix.'.',
90 90
             'encoding' => $this->getEncoding(), // $this->encoding
91 91
             'backend' => $this->getBackend());
92 92
 
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Newsletter/Server.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@
 block discarded – undo
18 18
     private $subscriber;
19 19
     private $credentials;
20 20
 
21
+    /**
22
+     * @param integer $list_id
23
+     */
21 24
     private function factoryList($list_id)
22 25
     {
23 26
         $this->list = new NewsletterList($this->kernel, $list_id);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         if (!$this->subscriber->unsubscribe($email)) {
75 75
             require_once 'XML/RPC2/Exception.php';
76
-            throw new XML_RPC2_FaultException('you could not unsubscribe with ' .$email, -4);
76
+            throw new XML_RPC2_FaultException('you could not unsubscribe with '.$email, -4);
77 77
         }
78 78
 
79 79
         return true;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     function getListIdFromOptinCode($credentials, $code)
176 176
     {
177 177
         $db = MDB2::singleton(DB_DSN);
178
-        $result = $db->query('SELECT list_id FROM newsletter_subscriber WHERE code = ' . $db->quote($code, 'text'));
178
+        $result = $db->query('SELECT list_id FROM newsletter_subscriber WHERE code = '.$db->quote($code, 'text'));
179 179
         if ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
180 180
             return $row['list_id'];
181 181
         }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     {
194 194
         if (count($credentials) != 2) { // -4
195 195
             require_once 'XML/RPC2/Exception.php';
196
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
196
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
197 197
         }
198 198
         if (empty($credentials['private_key'])) { // -5
199 199
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Server.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
      *
53 53
      * @param struct $credentials Credentials to use the server
54 54
      *
55
-     * @return array
55
+     * @return boolean
56 56
      */
57 57
     protected function checkCredentials($credentials)
58 58
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,8 +110,8 @@
 block discarded – undo
110 110
     {
111 111
         if ($value === null) {
112 112
             return '';
113
-       }
114
-       return $value;
113
+        }
114
+        return $value;
115 115
     }
116 116
 
117 117
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
         if (count($credentials) != 2) { // -4
62 62
             require_once 'XML/RPC2/Exception.php';
63
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
63
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
64 64
         }
65 65
         if (empty($credentials['private_key'])) { // -5
66 66
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Server0100.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
      *
62 62
      * @param struct $credentials Credentials to use the server
63 63
      *
64
-     * @return array
64
+     * @return boolean
65 65
      */
66 66
     protected function checkCredentials($credentials)
67 67
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,8 +140,8 @@
 block discarded – undo
140 140
     {
141 141
         if (is_null($value)) {
142 142
             return '';
143
-       }
144
-       return $value;
143
+        }
144
+        return $value;
145 145
     }
146 146
 
147 147
     protected function recursiveMap($function, $values)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 
70 70
         if (count($credentials) != 2) { // -4
71 71
             require_once 'XML/RPC2/Exception.php';
72
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
72
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
73 73
         }
74 74
         if (empty($credentials['private_key'])) { // -5
75 75
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Server0200.php 3 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,6 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * Constructor
51 51
      *
52
-     * @param string  $encoding The encoding wich the server recieves and returns data in
53 52
      *
54 53
      * @return void
55 54
      */
@@ -62,7 +61,7 @@  discard block
 block discarded – undo
62 61
      *
63 62
      * @param struct $credentials Credentials to use the server
64 63
      *
65
-     * @return array
64
+     * @return boolean
66 65
      */
67 66
     protected function checkCredentials($credentials)
68 67
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,8 +129,8 @@
 block discarded – undo
129 129
     {
130 130
         if (is_null($value)) {
131 131
             return '';
132
-       }
133
-       return $value;
132
+        }
133
+        return $value;
134 134
     }
135 135
 
136 136
     protected function recursiveMap($function, $values)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
         if (count($credentials) != 2) { // -4
72 72
             require_once 'XML/RPC2/Exception.php';
73
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
73
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
74 74
         }
75 75
         if (empty($credentials['private_key'])) { // -5
76 76
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.