@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use \Richdynamix\PersonalisedProducts\Console\Command\AbstractOrdersCommand; |
| 6 | 6 | use Symfony\Component\Console\Command\Command; |
| 7 | -use Symfony\Component\Console\Input\InputOption; |
|
| 8 | 7 | use Symfony\Component\Console\Input\InputInterface; |
| 9 | 8 | use Symfony\Component\Console\Output\OutputInterface; |
| 10 | 9 | use \Symfony\Component\Config\Definition\Exception\Exception; |
@@ -37,21 +37,21 @@ |
||
| 37 | 37 | protected function execute(InputInterface $input, OutputInterface $output) |
| 38 | 38 | { |
| 39 | 39 | $customerProducts = $this->_getCustomerProductCollection($this->_getOrderCollection()); |
| 40 | - $output->writeln('Preparing to send '. count($customerProducts) .' orders'); |
|
| 40 | + $output->writeln('Preparing to send '.count($customerProducts).' orders'); |
|
| 41 | 41 | $output->writeln( |
| 42 | - 'Preparing ' . $this->_getCustomerCount() . ' customers with a total of ' . |
|
| 43 | - $this->_getProductCount() . ' products' |
|
| 42 | + 'Preparing '.$this->_getCustomerCount().' customers with a total of '. |
|
| 43 | + $this->_getProductCount().' products' |
|
| 44 | 44 | ); |
| 45 | 45 | |
| 46 | 46 | try { |
| 47 | 47 | $sentCount = $this->_sendCustomerBuyProductData($customerProducts); |
| 48 | 48 | $output->writeln( |
| 49 | - 'Successfully set a total of ' . $this->_getProductCount() |
|
| 50 | - . ' product purchases to ' . $this->_getCustomerCount() . ' customers' . |
|
| 51 | - ' on a total of ' . $sentCount . ' orders' |
|
| 49 | + 'Successfully set a total of '.$this->_getProductCount() |
|
| 50 | + . ' product purchases to '.$this->_getCustomerCount().' customers'. |
|
| 51 | + ' on a total of '.$sentCount.' orders' |
|
| 52 | 52 | ); |
| 53 | 53 | } catch (Exception $e) { |
| 54 | - $output->writeln('Error: ' . $e->getMessage()); |
|
| 54 | + $output->writeln('Error: '.$e->getMessage()); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -125,7 +125,6 @@ |
||
| 125 | 125 | /** |
| 126 | 126 | * Set table row increment ID |
| 127 | 127 | * |
| 128 | - * @param mixed $id |
|
| 129 | 128 | * @return $this |
| 130 | 129 | */ |
| 131 | 130 | public function setId($incrementId) |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | /** |
| 105 | 105 | * Add query properties to the data in the query for PredictionIO engine |
| 106 | 106 | * |
| 107 | - * @param $property |
|
| 107 | + * @param string $property |
|
| 108 | 108 | * @param $data |
| 109 | 109 | * @param $propertyData |
| 110 | 110 | * @return $this |
@@ -84,8 +84,8 @@ |
||
| 84 | 84 | try { |
| 85 | 85 | $data = [ |
| 86 | 86 | |
| 87 | - 'items' => $productIds, |
|
| 88 | - 'num' => (int) $this->_config->getProductCount(Config::SIMILARITY_PRODUCT_COUNT), |
|
| 87 | + 'items' => $productIds, |
|
| 88 | + 'num' => (int) $this->_config->getProductCount(Config::SIMILARITY_PRODUCT_COUNT), |
|
| 89 | 89 | ]; |
| 90 | 90 | |
| 91 | 91 | $this->_addProperties('categories', $data, $categories); |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | /** |
| 122 | 122 | * Method for sending user-action-item events |
| 123 | 123 | * |
| 124 | - * @param $action |
|
| 125 | - * @param $customerId |
|
| 126 | - * @param $productId |
|
| 124 | + * @param string $action |
|
| 125 | + * @param integer $customerId |
|
| 126 | + * @param integer $productId |
|
| 127 | 127 | * @return bool |
| 128 | 128 | */ |
| 129 | 129 | private function _setCustomerToItemAction($action, $customerId, $productId) |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | /** |
| 150 | 150 | * Method to send individual entities |
| 151 | 151 | * |
| 152 | - * @param $entityType |
|
| 153 | - * @param $entityId |
|
| 152 | + * @param string $entityType |
|
| 153 | + * @param integer $entityId |
|
| 154 | 154 | * @param null $properties |
| 155 | 155 | * @return bool |
| 156 | 156 | */ |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $ordersCollection = $order->getCollection() |
| 82 | 82 | ->addFieldToSelect(['entity_id', 'customer_id']) |
| 83 | 83 | ->addFieldToFilter('state', ['eq' => 'complete']) |
| 84 | - ->addFieldToFilter('customer_id', array('neq' => 'NULL' )); |
|
| 84 | + ->addFieldToFilter('customer_id', array('neq' => 'NULL')); |
|
| 85 | 85 | |
| 86 | 86 | return $ordersCollection->getData(); |
| 87 | 87 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Product ID to export |
| 22 | 22 | */ |
| 23 | - const PRODUCT_ID = 'product_id'; |
|
| 23 | + const PRODUCT_ID = 'product_id'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Table row created time |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * Table row updated time |
| 32 | 32 | */ |
| 33 | - const UPDATE_TIME = 'update_time'; |
|
| 33 | + const UPDATE_TIME = 'update_time'; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Is the product exported |
| 37 | 37 | */ |
| 38 | - const IS_EXPORTED = 'is_exported'; |
|
| 38 | + const IS_EXPORTED = 'is_exported'; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Get the table increment ID |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | /** |
| 115 | 115 | * Helper method to read the cookie information |
| 116 | 116 | * |
| 117 | - * @param $name |
|
| 117 | + * @param string $name |
|
| 118 | 118 | * @return null|string |
| 119 | 119 | */ |
| 120 | 120 | private function _getCookie($name) |
@@ -55,6 +55,6 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function getProductViewUrl() |
| 57 | 57 | { |
| 58 | - return $this->getBaseUrl() . "personalised/products/productView/id/" . $this->getProductId(); |
|
| 58 | + return $this->getBaseUrl()."personalised/products/productView/id/".$this->getProductId(); |
|
| 59 | 59 | } |
| 60 | 60 | } |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | */ |
| 132 | 132 | public function getUpsellAjaxUrl() |
| 133 | 133 | { |
| 134 | - return $this->getBaseUrl() . "personalised/products/upsellAjax/id/" . $this->getProduct()->getId(); |
|
| 134 | + return $this->getBaseUrl()."personalised/products/upsellAjax/id/".$this->getProduct()->getId(); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |