Completed
Pull Request — master (#26)
by Lars
10:03
created
src/Intraface/XMLRPC/Shop/Server0100.php 3 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -250,6 +250,7 @@  discard block
 block discarded – undo
250 250
      * Formats array to return from product list from Doctrine
251 251
      *
252 252
      * @param object $doctrine_products Doctrine_Collection
253
+     * @param integer $attribute_id
253 254
      * @return array with products
254 255
      */
255 256
     private function createDoctrineProductsListArray($doctrine_products, $attribute_id = null)
@@ -563,7 +564,6 @@  discard block
 block discarded – undo
563 564
      *
564 565
      * @param struct  $credentials Credentials to use the server
565 566
      * @param integer $shop_id    Id for the shop
566
-     * @param integer $id          Product id
567 567
      *
568 568
      * @return array
569 569
      */
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
      *
742 742
      * @param struct  $credentials       Credentials to use the server
743 743
      * @param integer $shop_id    Id for the shop
744
-     * @param integer $produt_id         Product id to add
744
+     * @param integer $product_id         Product id to add
745 745
      * @param integer $product_variation_id Product variation id to change
746 746
      * @param integer $quantity          Optional quantity
747 747
      * @param string  $text              Extra text to the itemline
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
      * @param string  $text              Extra text to the itemline
785 785
      * @param integer $product_detail_id Product detail id
786 786
      *
787
-     * @return mixed
787
+     * @return boolean
788 788
      */
789 789
     public function changeProductInBasket($credentials, $shop_id, $product_id, $product_variation_id, $quantity, $text = '', $product_detail_id = 0)
790 790
     {
@@ -1238,6 +1238,7 @@  discard block
 block discarded – undo
1238 1238
     /**
1239 1239
      * Initialize the webshop
1240 1240
      *
1241
+     * @param integer $shop_id
1241 1242
      * @return void
1242 1243
      */
1243 1244
     private function _factoryWebshop($shop_id)
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         return $this->prepareResponseData($this->cleanUpProductList($product->getRelatedProducts($currencies, 'webshop')));
427 427
     }
428 428
 
429
-   /**
429
+    /**
430 430
      * Gets featured products
431 431
      *
432 432
      * Method is experimental and only used by discimport.dk. If you need to use it
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 
478 478
     }
479 479
 
480
-   /**
480
+    /**
481 481
      * Gets product keywords which can be used to sort ones webshop
482 482
      *
483 483
      *
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -72,40 +72,40 @@  discard block
 block discarded – undo
72 72
         }
73 73
 
74 74
         // sublevel has to be used so other searches are not overwritten
75
-        $product->getDBQuery()->storeResult('use_stored', 'webshop_' . $area . '_' .  md5($this->credentials['session_id']), 'sublevel');
75
+        $product->getDBQuery()->storeResult('use_stored', 'webshop_'.$area.'_'.md5($this->credentials['session_id']), 'sublevel');
76 76
         $debug2 = serialize($mixed);
77 77
         if (isset($mixed['offset']) and is_numeric($mixed['offset']) and $mixed['offset'] > 0) {
78 78
             $product->getDBQuery()->useStored(true);
79 79
             $product->getDBQuery()->setPagingOffset((int)$mixed['offset']);
80
-            $debug2 .= 'offset ' . $mixed['offset'];
80
+            $debug2 .= 'offset '.$mixed['offset'];
81 81
         } elseif (isset($mixed['use_stored']) and array_key_exists('use_stored', $mixed) and $mixed['use_stored'] == 'true') {
82 82
             $product->getDBQuery()->useStored(true);
83 83
             $debug2 .= 'use_stored true';
84 84
         } else {
85 85
             if (array_key_exists('search', $mixed) and !empty($mixed['search'])) {
86 86
                 $product->getDBQuery()->setFilter('search', $mixed['search']);
87
-                $debug2 .= 'search ' . $mixed['search'];
87
+                $debug2 .= 'search '.$mixed['search'];
88 88
             }
89 89
 
90 90
             if (array_key_exists('keywords', $mixed) and !empty($mixed['keywords'])) {
91 91
                 $product->getDBQuery()->setFilter('keywords', $mixed['keywords']);
92
-                $debug2 .= 'keyword ' . $mixed['keywords'];
92
+                $debug2 .= 'keyword '.$mixed['keywords'];
93 93
             }
94 94
 
95 95
             if (array_key_exists('category', $mixed) and !empty($mixed['category'])) {
96 96
                 $product->getDBQuery()->setFilter('shop_id', $shop_id);
97 97
                 $product->getDBQuery()->setFilter('category', $mixed['category']);
98
-                $debug2 .= 'category ' . $mixed['category'];
98
+                $debug2 .= 'category '.$mixed['category'];
99 99
             }
100 100
 
101 101
             if (isset($mixed['ids']) and array_key_exists('ids', $mixed) and is_array($mixed['ids'])) {
102 102
                 $product->getDBQuery()->setFilter('ids', $mixed['ids']);
103
-                $debug2 .= 'ids ' . implode(', ', $mixed['ids']);
103
+                $debug2 .= 'ids '.implode(', ', $mixed['ids']);
104 104
             }
105 105
 
106 106
             if (array_key_exists('sorting', $mixed) and !empty($mixed['sorting'])) {
107 107
                 $product->getDBQuery()->setFilter('sorting', $mixed['sorting']);
108
-                $debug2 .= 'sorting ' . $mixed['sorting'];
108
+                $debug2 .= 'sorting '.$mixed['sorting'];
109 109
             }
110 110
         }
111 111
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 
450 450
         if (PEAR::isError($db)) {
451 451
             require_once 'XML/RPC2/Exception.php';
452
-            throw new XML_RPC2_FaultException($db->getMessage() . $db->getUserInfo(), -1);
452
+            throw new XML_RPC2_FaultException($db->getMessage().$db->getUserInfo(), -1);
453 453
         }
454 454
 
455 455
         $featured = new Intraface_modules_shop_FeaturedProducts($this->kernel->intranet, $this->webshop->getShop(), $db);
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 
717 717
         if (!$order_id = $this->webshop->placeOrder($values)) {
718 718
             require_once 'XML/RPC2/Exception.php';
719
-            throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
719
+            throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
720 720
         }
721 721
 
722 722
         return $this->prepareResponseData($this->webshop->getOrderIdentifierKey());
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 
747 747
         if (!$this->webshop->getBasket()->saveAddress($values)) {
748 748
             require_once 'XML/RPC2/Exception.php';
749
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
749
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
750 750
         }
751 751
 
752 752
         return $this->prepareResponseData(true);
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
         $customer_coupon = $this->processRequestData($customer_coupon);
788 788
         if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) {
789 789
             require_once 'XML/RPC2/Exception.php';
790
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
790
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
791 791
         }
792 792
 
793 793
         return $this->prepareResponseData(true);
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
         $customer_ean = $this->processRequestData($customer_ean);
829 829
         if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) {
830 830
             require_once 'XML/RPC2/Exception.php';
831
-            throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
831
+            throw new XML_RPC2_FaultException('ean could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
832 832
         }
833 833
 
834 834
         return $this->prepareResponseData(true);
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
         $customer_comment = $this->processRequestData($customer_comment);
871 871
         if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) {
872 872
             require_once 'XML/RPC2/Exception.php';
873
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
873
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
874 874
         }
875 875
 
876 876
         return $this->prepareResponseData(true);
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
         $payment_method = $this->processRequestData($payment_method);
930 930
         if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) {
931 931
             require_once 'XML/RPC2/Exception.php';
932
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
932
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
933 933
         }
934 934
 
935 935
         return $this->prepareResponseData(true);
Please login to merge, or discard this patch.
tests/unit/Accounting/VatPeriodTest.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -48,6 +48,9 @@  discard block
 block discarded – undo
48 48
         $this->value['saldo'] = 100;
49 49
     }
50 50
 
51
+    /**
52
+     * @param string $type
53
+     */
51 54
     function getSaldo($type, $date_from, $date_to)
52 55
     {
53 56
 
@@ -79,6 +82,9 @@  discard block
 block discarded – undo
79 82
         return 1;
80 83
     }
81 84
 
85
+    /**
86
+     * @param integer $id
87
+     */
82 88
     function getAccount($id)
83 89
     {
84 90
         return new FakeVatPeriodAccount(new FakeVatPeriodYear, $id);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         // ganges med -1 for at f� rigtigt fortegn til udregning
106 106
         $this->value['saldo_vat_out'] = $account_vat_in->get('saldo');
107
-        $saldo_total += -1 * $this->value['saldo_vat_out']; // total
107
+        $saldo_total += -1*$this->value['saldo_vat_out']; // total
108 108
 
109 109
 
110 110
         // Moms af varek�b i udlandet
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
         // ganges med -1 for at f� rigtigt fortegn til udregning
117 117
         $this->value['saldo_vat_abroad'] = $account_vat_abroad->get('saldo');
118
-        $saldo_total += -1 * $this->value['saldo_vat_abroad'];
118
+        $saldo_total += -1*$this->value['saldo_vat_abroad'];
119 119
 
120 120
         // K�bsmoms
121 121
         // K�bsmomsen inkluderer ogs� den udregnede moms af moms af varek�b i udlandet.
Please login to merge, or discard this patch.
tests/unit/CMS/CMSStubs.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -8,6 +8,10 @@  discard block
 block discarded – undo
8 8
     public $kernel;
9 9
     public $cmssite;
10 10
     public $dbquery;
11
+
12
+    /**
13
+     * @param FakeCMSSite $site
14
+     */
11 15
     function __construct($site)
12 16
     {
13 17
         $this->cmssite = $site;
@@ -37,6 +41,10 @@  discard block
 block discarded – undo
37 41
 {
38 42
     public $kernel;
39 43
     public $cmssite;
44
+
45
+    /**
46
+     * @param FakeCMSPage $page
47
+     */
40 48
     function __construct($page)
41 49
     {
42 50
         $this->cmspage = $page;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     {
13 13
         $this->cmssite = $site;
14 14
         $this->kernel = $site->kernel;
15
-        $this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id'));
15
+        $this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = '.$this->cmssite->get('id'));
16 16
     }
17 17
     function get()
18 18
     {
Please login to merge, or discard this patch.
tests/unit/CMS/PageTest.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -6,6 +6,9 @@
 block discarded – undo
6 6
 {
7 7
     public $kernel;
8 8
 
9
+    /**
10
+     * @param Stub_Kernel $kernel
11
+     */
9 12
     function __construct($kernel)
10 13
     {
11 14
         $this->kernel = $kernel;
Please login to merge, or discard this patch.
tests/unit/CMS/SectionTest.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -9,6 +9,9 @@
 block discarded – undo
9 9
     public $kernel;
10 10
     public $cmssite;
11 11
 
12
+    /**
13
+     * @param Stub_Kernel $kernel
14
+     */
12 15
     function __construct($kernel)
13 16
     {
14 17
         $this->kernel = $kernel;
Please login to merge, or discard this patch.
tests/unit/Common/DBQueryTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -52,6 +52,9 @@
 block discarded – undo
52 52
         }
53 53
     }
54 54
 
55
+    /**
56
+     * @param string $post
57
+     */
55 58
     function createPost($post)
56 59
     {
57 60
         $result = $this->db->exec('INSERT INTO ' . $this->table . ' (name) VALUES ('.$this->db->quote($post, 'text').')');
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
         $result = $this->db->exec('TRUNCATE TABLE dbquery_result');
19 19
 
20
-        $result = $this->db->exec('DROP TABLE ' . $this->table);
20
+        $result = $this->db->exec('DROP TABLE '.$this->table);
21 21
         /*
22 22
          TODO: DROP THE TABLE IF IT EXISTS
23 23
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         }
29 29
         */
30 30
 
31
-        $result = $this->db->exec('CREATE TABLE ' . $this->table . '(
31
+        $result = $this->db->exec('CREATE TABLE '.$this->table.'(
32 32
             id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, PRIMARY KEY  (id))');
33 33
 
34 34
         if (PEAR::isError($result)) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     function createPost($post)
56 56
     {
57
-        $result = $this->db->exec('INSERT INTO ' . $this->table . ' (name) VALUES ('.$this->db->quote($post, 'text').')');
57
+        $result = $this->db->exec('INSERT INTO '.$this->table.' (name) VALUES ('.$this->db->quote($post, 'text').')');
58 58
         if (PEAR::isError($result)) {
59 59
             die($result->getUserInfo());
60 60
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     function tearDown()
64 64
     {
65
-        $result = $this->db->exec('DROP TABLE ' . $this->table);
65
+        $result = $this->db->exec('DROP TABLE '.$this->table);
66 66
     }
67 67
 
68 68
     ///////////////////////////////////////////////////////////////////////////
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $this->assertEquals($paging_name, $dbquery->getPagingVarName());
106 106
 
107 107
         $paging = $dbquery->getPaging();
108
-        $expected_offset = array(1=>0, 2=>2, 3=>4, 4=>6, 5=>8, 6=>10, 7=>12, 8=>14, 9=>16,10=>18,11=>20);
108
+        $expected_offset = array(1=>0, 2=>2, 3=>4, 4=>6, 5=>8, 6=>10, 7=>12, 8=>14, 9=>16, 10=>18, 11=>20);
109 109
         $this->assertEquals($expected_offset, $paging['offset']);
110 110
         $this->assertEquals(0, $paging['previous']);
111 111
         $this->assertEquals(2, $paging['next']);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         $db = $dbquery->getRecordset('id, name');
121 121
         $i = 0;
122
-        while($db->nextRecord()) {
122
+        while ($db->nextRecord()) {
123 123
             $result[$i]['id'] = $db->f('id');
124 124
             $result[$i]['name'] = $db->f('name');
125 125
             $i++;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
142 142
         $db = $dbquery->getRecordset('id, name');
143 143
         $i = 0;
144
-        while($db->nextRecord()) {
144
+        while ($db->nextRecord()) {
145 145
             $result[$i]['id'] = $db->f('id');
146 146
             $result[$i]['name'] = $db->f('name');
147 147
             $i++;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
169 169
         $db = $dbquery->getRecordset('id, name');
170 170
         $i = 0;
171
-        while($db->nextRecord()) {
171
+        while ($db->nextRecord()) {
172 172
             $result[$i]['id'] = $db->f('id');
173 173
             $result[$i]['name'] = $db->f('name');
174 174
             $i++;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
196 196
         $db = $dbquery->getRecordset('id, name');
197 197
         $i = 0;
198
-        while($db->nextRecord()) {
198
+        while ($db->nextRecord()) {
199 199
             $result[$i]['id'] = $db->f('id');
200 200
             $result[$i]['name'] = $db->f('name');
201 201
             $i++;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
223 223
         $db = $dbquery->getRecordset('id, name');
224 224
         $i = 0;
225
-        while($db->nextRecord()) {
225
+        while ($db->nextRecord()) {
226 226
             $result[$i]['id'] = $db->f('id');
227 227
             $result[$i]['name'] = $db->f('name');
228 228
             $i++;
Please login to merge, or discard this patch.
tests/unit/Contact/ContactStubs.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -4,6 +4,9 @@
 block discarded – undo
4 4
     private $id = 1;
5 5
     public $kernel;
6 6
 
7
+    /**
8
+     * @param FakeContactKernel $kernel
9
+     */
7 10
     function __construct($kernel)
8 11
     {
9 12
         $this->kernel = $kernel;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
     function useShared($shared)
44 44
     {
45
-        switch($shared) {
45
+        switch ($shared) {
46 46
             case 'email':
47 47
                 require_once 'Intraface/shared/email/Email.php';
48 48
                 break;
Please login to merge, or discard this patch.
tests/unit/Debtor/DebtorTest.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -63,6 +63,10 @@  discard block
 block discarded – undo
63 63
 class FakeDebtorSetting
64 64
 {
65 65
 
66
+    /**
67
+     * @param string $type
68
+     * @param string $setting
69
+     */
66 70
     function get($type, $setting)
67 71
     {
68 72
 
@@ -145,6 +149,9 @@  discard block
 block discarded – undo
145 149
 
146 150
     }
147 151
 
152
+    /**
153
+     * @param Invoice $debtor
154
+     */
148 155
     function createPayment($debtor)
149 156
     {
150 157
         $payment = new Payment($debtor);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     }
42 42
     function get($key = '')
43 43
     {
44
-        $info = array('name' => 'Intranetname', 'contact_person' => '','id' => 1);
44
+        $info = array('name' => 'Intranetname', 'contact_person' => '', 'id' => 1);
45 45
         if (empty($key)) {
46 46
             return $info;
47 47
         } else {
Please login to merge, or discard this patch.
tests/unit/Filehandler/file_functions.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -1,4 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
+/**
3
+ * @param string $f
4
+ */
2 5
 function fht_deltree($f)
3 6
 {
4 7
 
@@ -16,6 +19,9 @@  discard block
 block discarded – undo
16 19
 }
17 20
 
18 21
 
22
+/**
23
+ * @param string $f
24
+ */
19 25
 function iht_deltree($f)
20 26
 {
21 27
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
             if (!strcmp($item, '.') || !strcmp($item, '..')) {
8 8
                 continue;
9 9
             }
10
-            fht_deltree($f . "/" . $item);
10
+            fht_deltree($f."/".$item);
11 11
         }
12 12
         rmdir($f);
13
-    } else{
13
+    } else {
14 14
         @unlink($f);
15 15
     }
16 16
 }
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
             if (!strcmp($item, '.') || !strcmp($item, '..')) {
25 25
                 continue;
26 26
             }
27
-            iht_deltree($f . "/" . $item);
27
+            iht_deltree($f."/".$item);
28 28
         }
29 29
         rmdir($f);
30
-    } else{
30
+    } else {
31 31
         @unlink($f);
32 32
     }
33 33
 }
Please login to merge, or discard this patch.