Completed
Pull Request — master (#21)
by Lars
14:31
created
src/Intraface/XMLRPC/OnlinePayment/Server.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         if (!$payment_id = $onlinepayment->save($values)) {
97 97
             // this is probably a little to hard reaction.
98
-            throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt ' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
98
+            throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt '.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
99 99
         }
100 100
 
101 101
         $this->sendEmailOnOnlinePayment($debtor, $payment_id);
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
         $this->kernel->useShared('email');
109 109
         $email = new Email($this->kernel);
110 110
 
111
-        $subject = 'Payment confirmation / betalingsbekræftelse (#' . $payment_id . ')';
112
-        $body    = 'We have received your payment for order #' .$debtor->getId(). '.' . "\n\n";
113
-        $body   .= 'Vi har modtaget din betaling for ordre #' .$debtor->getId(). '.';
114
-        $body   .= "\n\nYours sincerely / Venlig hilsen\n".  $this->kernel->intranet->address->get('name');
111
+        $subject = 'Payment confirmation / betalingsbekræftelse (#'.$payment_id.')';
112
+        $body    = 'We have received your payment for order #'.$debtor->getId().'.'."\n\n";
113
+        $body   .= 'Vi har modtaget din betaling for ordre #'.$debtor->getId().'.';
114
+        $body   .= "\n\nYours sincerely / Venlig hilsen\n".$this->kernel->intranet->address->get('name');
115 115
 
116 116
         $data = array('contact_id' => $debtor->getContact()->getId(),
117 117
                       'subject'    => $subject,
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         if (!$email->queue()) {
131 131
             $this->error->merge($email->error->getMessage());
132
-            throw new Exception('Could not send email to ' . $debtor->getContact()->getId());
132
+            throw new Exception('Could not send email to '.$debtor->getContact()->getId());
133 133
             ;
134 134
             return false;
135 135
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
         if (!$payment_id = $onlinepayment->create()) {
155 155
             // this is probably a little to hard reaction
156
-            throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
156
+            throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
157 157
         }
158 158
 
159 159
         return $this->prepareResponseData($payment_id);
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -182,12 +182,12 @@
 block discarded – undo
182 182
         }
183 183
 
184 184
         $data = array('contact_id' => $debtor->getContact()->getId(),
185
-                      'subject'    => $subject,
186
-                      'body'       => $body,
187
-                      'from_email' => $this->kernel->intranet->address->get('email'),
188
-                      'from_name'  => $this->kernel->intranet->address->get('name'),
189
-                      'type_id'    => 13, // onlinepayment
190
-                      'belong_to'  => $payment_id);
185
+                        'subject'    => $subject,
186
+                        'body'       => $body,
187
+                        'from_email' => $this->kernel->intranet->address->get('email'),
188
+                        'from_name'  => $this->kernel->intranet->address->get('name'),
189
+                        'type_id'    => 13, // onlinepayment
190
+                        'belong_to'  => $payment_id);
191 191
 
192 192
         if (!$email->save($data)) {
193 193
             throw new Exception('Could not save email to onlinepayment');
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/OnlinePayment/Server0100.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -182,12 +182,12 @@
 block discarded – undo
182 182
         }
183 183
 
184 184
         $data = array('contact_id' => $debtor->getContact()->getId(),
185
-                      'subject'    => $subject,
186
-                      'body'       => $body,
187
-                      'from_email' => $this->kernel->intranet->address->get('email'),
188
-                      'from_name'  => $this->kernel->intranet->address->get('name'),
189
-                      'type_id'    => 13, // onlinepayment
190
-                      'belong_to'  => $payment_id);
185
+                        'subject'    => $subject,
186
+                        'body'       => $body,
187
+                        'from_email' => $this->kernel->intranet->address->get('email'),
188
+                        'from_name'  => $this->kernel->intranet->address->get('name'),
189
+                        'type_id'    => 13, // onlinepayment
190
+                        'belong_to'  => $payment_id);
191 191
 
192 192
         if (!$email->save($data)) {
193 193
             throw new Exception('Could not save email to onlinepayment');
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         if (!$payment_id = $onlinepayment->save($values)) {
135 135
             // this is probably a little to hard reaction.
136
-            throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt ' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
136
+            throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt '.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
137 137
         }
138 138
 
139 139
         if ($onlinepayment->get('status') == 'authorized') {
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
             // @todo: Change with gateway.
167 167
             $settings = $doctrine->getTable('Intraface_modules_onlinepayment_Language')->findOneByIntranetId($kernel->intranet->getId());
168 168
 
169
-            $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()) . ' (#' . $payment_id . ')';
170
-            $body = $settings->getConfirmationEmailBody($shop->getLanguage()) . "\n\n" . $this->kernel->intranet->address->get('name');
169
+            $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()).' (#'.$payment_id.')';
170
+            $body = $settings->getConfirmationEmailBody($shop->getLanguage())."\n\n".$this->kernel->intranet->address->get('name');
171 171
         } catch (Exception $e) {
172 172
         }
173 173
 
174 174
         if (empty($subject)) {
175
-            $subject = 'Payment confirmation / betalingsbekræftelse (#' . $payment_id . ')';
175
+            $subject = 'Payment confirmation / betalingsbekræftelse (#'.$payment_id.')';
176 176
         }
177 177
 
178 178
         if (empty($body)) {
179
-            $body    = 'We have received your payment for order #' .$debtor->getId(). '.' . "\n\n";
180
-            $body   .= 'Vi har modtaget din betaling for ordre #' .$debtor->getId(). '.';
181
-            $body   .= "\n\nYours sincerely / Venlig hilsen\n".  $this->kernel->intranet->address->get('name');
179
+            $body    = 'We have received your payment for order #'.$debtor->getId().'.'."\n\n";
180
+            $body   .= 'Vi har modtaget din betaling for ordre #'.$debtor->getId().'.';
181
+            $body   .= "\n\nYours sincerely / Venlig hilsen\n".$this->kernel->intranet->address->get('name');
182 182
         }
183 183
 
184 184
         $data = array('contact_id' => $debtor->getContact()->getId(),
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
         if (!$email->queue()) {
197 197
             $this->error->merge($email->error->getMessage());
198
-            throw new Exception('Could not send email to ' . $debtor->getContact()->getId());
198
+            throw new Exception('Could not send email to '.$debtor->getContact()->getId());
199 199
         }
200 200
 
201 201
         return true;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         if (!$payment_id = $onlinepayment->create()) {
217 217
             // this is probably a little to hard reaction
218
-            throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
218
+            throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4);
219 219
         }
220 220
 
221 221
         return $this->prepareResponseData($payment_id);
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Admin/Server.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -70,13 +70,13 @@
 block discarded – undo
70 70
         );
71 71
     }
72 72
 
73
-       /**
74
-     * Checking credentials
75
-     *
76
-     * @param struct $master_password
77
-     *
78
-     * @return boolean
79
-     */
73
+        /**
74
+         * Checking credentials
75
+         *
76
+         * @param struct $master_password
77
+         *
78
+         * @return boolean
79
+         */
80 80
     private function checkMasterpassword($master_password)
81 81
     {
82 82
         if ($master_password != 'abcdefghijklmnopqrstuvwxyz123456789#') {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
         $db = MDB2::singleton(DB_DSN);
30 30
 
31 31
         if (PEAR::isError($db)) {
32
-            throw new XML_RPC2_Exception('error accessing the database ' . $db->getUserInfo());
32
+            throw new XML_RPC2_Exception('error accessing the database '.$db->getUserInfo());
33 33
         }
34 34
 
35 35
         $db->setFetchMode(MDB2_FETCHMODE_ASSOC);
36 36
         $result = $db->query("SELECT id, name, private_key FROM intranet WHERE identifier = ".$db->quote($intranet_identifier, 'text')." AND identifier <> ''");
37 37
 
38 38
         if (PEAR::isError($result)) {
39
-            throw new XML_RPC2_Exception('error querying the database ' . $result->getUserInfo());
39
+            throw new XML_RPC2_Exception('error querying the database '.$result->getUserInfo());
40 40
         }
41 41
 
42 42
         if ($result->numRows() <> 1) {
Please login to merge, or discard this patch.
src/Intraface/Main.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     function includeFile($file)
161 161
     {
162 162
         // @todo constant should be removed
163
-        $file = PATH_INCLUDE_MODULE . $this->module_name . '/' . $file;
163
+        $file = PATH_INCLUDE_MODULE.$this->module_name.'/'.$file;
164 164
         if (!file_exists($file)) {
165 165
             return false;
166 166
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         // @todo global should be removed
220 220
         global $_setting; // globalized other places also
221 221
 
222
-        include(dirname(__FILE__). '/modules/' .$this->module_name.'/'.$file);
222
+        include(dirname(__FILE__).'/modules/'.$this->module_name.'/'.$file);
223 223
     }
224 224
 
225 225
     /**
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     public function getPath()
231 231
     {
232
-        return PATH_WWW . 'restricted/module/' . $this->module_name . '/';
232
+        return PATH_WWW.'restricted/module/'.$this->module_name.'/';
233 233
     }
234 234
 
235 235
     /**
Please login to merge, or discard this patch.
tests/xmlrpcservers/index.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@
 block discarded – undo
34 34
 $HTTP_RAW_POST_DATA = file_get_contents('php://input');
35 35
 
36 36
 k()
37
-  ->setIdentityLoader(new MyIdentityLoader())
38
-  // Use container for wiring of components
39
-  // ->setComponentCreator(new k_InjectorAdapter(create_container()))
40
-  // Enable file logging
41
-  //->setLog(dirname(__FILE__) . '/../log/debug.log')
42
-  // Uncomment the next line to enable in-browser debugging
43
-  //->setDebug()
44
-  // Dispatch request
45
-  ->run('Intraface_XMLRPC_Controller')
46
-  ->out();
37
+    ->setIdentityLoader(new MyIdentityLoader())
38
+    // Use container for wiring of components
39
+    // ->setComponentCreator(new k_InjectorAdapter(create_container()))
40
+    // Enable file logging
41
+    //->setLog(dirname(__FILE__) . '/../log/debug.log')
42
+    // Uncomment the next line to enable in-browser debugging
43
+    //->setDebug()
44
+    // Dispatch request
45
+    ->run('Intraface_XMLRPC_Controller')
46
+    ->out();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once dirname(__FILE__) . '/../unit/config.test.php';
2
+require_once dirname(__FILE__).'/../unit/config.test.php';
3 3
 
4 4
 require_once 'konstrukt/konstrukt.inc.php';
5 5
 
Please login to merge, or discard this patch.
tests/unit/Shop/ShopBasketTest.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
 
215 215
         $this->assertTrue($basket->removeEvaluationProducts());
216 216
 
217
-         $this->assertEquals(count($basket->getItems()), 0);
217
+            $this->assertEquals(count($basket->getItems()), 0);
218 218
     }
219 219
 
220 220
     function testSaveCustomerEan()
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
     function createProductWithVariations()
41 41
     {
42
-        require_once dirname(__FILE__) .'/../../../install/Helper/Product.php';
42
+        require_once dirname(__FILE__).'/../../../install/Helper/Product.php';
43 43
         $helper = new Install_Helper_Product($this->kernel, MDB2::singleton(DB_DSN));
44 44
         $helper->createWithVariations();
45 45
     }
Please login to merge, or discard this patch.
tests/unit/Filemanager/ImageRandomizerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 require_once 'Intraface/modules/filemanager/FileManager.php';
4 4
 require_once 'Intraface/modules/filemanager/ImageRandomizer.php';
5 5
 require_once 'Intraface/shared/keyword/Keyword.php';
6
-require_once dirname(__FILE__) . '/../Filehandler/file_functions.php';
6
+require_once dirname(__FILE__).'/../Filehandler/file_functions.php';
7 7
 
8 8
 class ImageRandomizerTest extends PHPUnit_Framework_TestCase
9 9
 {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         for ($i = 1; $i < 11; $i++) {
36 36
             $filemanager = new Intraface_modules_filemanager_FileManager($this->createKernel());
37
-            copy(dirname(__FILE__) . '/'.$this->file_name, PATH_UPLOAD.$this->file_name);
37
+            copy(dirname(__FILE__).'/'.$this->file_name, PATH_UPLOAD.$this->file_name);
38 38
             $filemanager->save(PATH_UPLOAD.$this->file_name, 'file'.$i.'.jpg');
39 39
             $appender = $filemanager->getKeywordAppender();
40 40
 
Please login to merge, or discard this patch.
tests/unit/Email/EmailTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
     function testALotOfSaveEmails()
79 79
     {
80 80
         $number = 200;
81
-        for ($i = 0; $i<$number; $i++) {
81
+        for ($i = 0; $i < $number; $i++) {
82 82
             $belong_to_id = rand(1, 100000);
83 83
             $type_id = rand(1, 5);
84 84
             $contact_id = rand(1, 100000);
Please login to merge, or discard this patch.
tests/unit/Contact/ContactReminderTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
     function testPostPhoneUntil()
27 27
     {
28 28
         $reminder = new ContactReminder($this->getContact());
29
-        $this->assertTrue($reminder->postponeUntil(date('Y-') . date('m') + 1 . date('-d')));
29
+        $this->assertTrue($reminder->postponeUntil(date('Y-').date('m') + 1.date('-d')));
30 30
     }
31 31
 }
Please login to merge, or discard this patch.