| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace Hideyo\Ecommerce\Framework\Services\Order; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | use Validator; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | use File; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | use Hideyo\Ecommerce\Framework\Services\Order\Entity\OrderRepository; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | use Hideyo\Ecommerce\Framework\Services\BaseService; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | use Hideyo\Ecommerce\Framework\Services\Client\ClientFacade as ClientService; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | use Hideyo\Ecommerce\Framework\Services\SendingMethod\SendingMethodFacade as SendingMethodService; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use Hideyo\Ecommerce\Framework\Services\PaymentMethod\PaymentMethodFacade as PaymentMethodService; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use Cart;  | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 14 |  |  | class OrderService extends BaseService | 
            
                                                                        
                            
            
                                    
            
            
                | 15 |  |  | { | 
            
                                                                        
                            
            
                                    
            
            
                | 16 |  |  | 	public function __construct(OrderRepository $order) | 
            
                                                                        
                            
            
                                    
            
            
                | 17 |  |  | 	{ | 
            
                                                                        
                            
            
                                    
            
            
                | 18 |  |  | 		$this->repo = $order; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 19 |  |  | 	}  | 
            
                                                                        
                            
            
                                    
            
            
                | 20 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 21 |  |  |     public function createAddress(array $attributes, $orderId) | 
            
                                                                        
                            
            
                                    
            
            
                | 22 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 23 |  |  |         if (auth('hideyobackend')->check()) { | 
            
                                                                        
                            
            
                                    
            
            
                | 24 |  |  |             $userId = auth('hideyobackend')->user()->id; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 25 |  |  |             $attributes['modified_by_user_id'] = $userId; | 
            
                                                                        
                            
            
                                    
            
            
                | 26 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 28 |  |  |         $attributes['order_id'] = $orderId;   | 
            
                                                                        
                            
            
                                    
            
            
                | 29 |  |  |         $this->getAddressModel()->fill($attributes); | 
            
                                                                        
                            
            
                                    
            
            
                | 30 |  |  |         $this->getAddressModel()->save(); | 
            
                                                                        
                            
            
                                    
            
            
                | 31 |  |  |          | 
            
                                                                        
                            
            
                                    
            
            
                | 32 |  |  |         return $this->getAddressModel(); | 
            
                                                                        
                            
            
                                    
            
            
                | 33 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 35 |  |  |     public function create(array $attributes) | 
            
                                                                        
                            
            
                                    
            
            
                | 36 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 37 |  |  |         $attributes['shop_id'] = auth('hideyobackend')->user()->selected_shop_id; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 38 |  |  |         $attributes['modified_by_user_id'] = auth('hideyobackend')->user()->id; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 39 |  |  |         $this->repo->getModel()->fill($attributes); | 
            
                                                                        
                            
            
                                    
            
            
                | 40 |  |  |         $this->repo->getModel()->save(); | 
            
                                                                        
                            
            
                                    
            
            
                | 41 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 42 |  |  |         if (isset($attributes['categories'])) { | 
            
                                                                        
                            
            
                                    
            
            
                | 43 |  |  |             $this->repo->getModel()->categories()->sync($attributes['categories']); | 
            
                                                                        
                            
            
                                    
            
            
                | 44 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 45 |  |  |          | 
            
                                                                        
                            
            
                                    
            
            
                | 46 |  |  |         return $this->model; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 47 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 48 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 49 |  |  |     public function updateById(array $attributes, $id) | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 51 |  |  |         $model = $this->find($id); | 
            
                                                                        
                            
            
                                    
            
            
                | 52 |  |  |         if (auth('hideyobackend')->check()) { | 
            
                                                                        
                            
            
                                    
            
            
                | 53 |  |  |             $attributes['shop_id'] = auth('hideyobackend')->user()->selected_shop_id; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 54 |  |  |             $attributes['modified_by_user_id'] = auth('hideyobackend')->user()->id; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 55 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 56 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 57 |  |  |         $model->fill($attributes); | 
            
                                                                        
                            
            
                                    
            
            
                | 58 |  |  |         return $model->save();    | 
            
                                                                        
                            
            
                                    
            
            
                | 59 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 60 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 61 |  |  |     public function addProducts($orderModel, $products)  | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |         foreach ($products  as $product) { | 
            
                                                                        
                            
            
                                    
            
            
                | 64 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 65 |  |  |             $quantity = $product->quantity; | 
            
                                                                        
                            
            
                                    
            
            
                | 66 |  |  |             $newProduct = array( | 
            
                                                                        
                            
            
                                    
            
            
                | 67 |  |  |                 'product_id' => $product['attributes']['id'], | 
            
                                                                        
                            
            
                                    
            
            
                | 68 |  |  |                 'title' => $product['attributes']['title'], | 
            
                                                                        
                            
            
                                    
            
            
                | 69 |  |  |                 'original_price_without_tax' => $product['attributes']['price_details']['original_price_ex_tax'], | 
            
                                                                        
                            
            
                                    
            
            
                | 70 |  |  |                 'original_price_with_tax' => $product['attributes']['price_details']['original_price_inc_tax'], | 
            
                                                                        
                            
            
                                    
            
            
                | 71 |  |  |                 'original_total_price_without_tax' => $quantity * $product['attributes']['price_details']['original_price_ex_tax'], | 
            
                                                                        
                            
            
                                    
            
            
                | 72 |  |  |                 'original_total_price_with_tax' => $quantity * $product['attributes']['price_details']['original_price_inc_tax'], | 
            
                                                                        
                            
            
                                    
            
            
                | 73 |  |  |                 'price_without_tax' => $product->getOriginalPriceWithoutTaxAndConditions(false), | 
            
                                                                        
                            
            
                                    
            
            
                | 74 |  |  |                 'price_with_tax' => $product->getOriginalPriceWithTaxAndConditions(false), | 
            
                                                                        
                            
            
                                    
            
            
                | 75 |  |  |                 'total_price_without_tax' => $product->getOriginalPriceWithoutTaxSum(false), | 
            
                                                                        
                            
            
                                    
            
            
                | 76 |  |  |                 'total_price_with_tax' => $product->getOriginalPriceWithTaxSum(false), | 
            
                                                                        
                            
            
                                    
            
            
                | 77 |  |  |                 'amount' => $quantity, | 
            
                                                                        
                            
            
                                    
            
            
                | 78 |  |  |                 'tax_rate' => $product['attributes']['tax_rate'], | 
            
                                                                        
                            
            
                                    
            
            
                | 79 |  |  |                 'tax_rate_id' => $product['attributes']['tax_rate_id'], | 
            
                                                                        
                            
            
                                    
            
            
                | 80 |  |  |                 'weight' => $product['attributes']['weight'], | 
            
                                                                        
                            
            
                                    
            
            
                | 81 |  |  |                 'reference_code' => $product['attributes']['reference_code'], | 
            
                                                                        
                            
            
                                    
            
            
                | 82 |  |  |             ); | 
            
                                                                        
                            
            
                                    
            
            
                | 83 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 84 |  |  |             if (isset($product['attributes']['product_combination_id'])) { | 
            
                                                                        
                            
            
                                    
            
            
                | 85 |  |  |                 $newProduct['product_attribute_id'] = $product['attributes']['product_combination_id']; | 
            
                                                                        
                            
            
                                    
            
            
                | 86 |  |  |                 $productCombinationTitleArray = array(); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 87 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 88 |  |  |                 if (isset($product['attributes']['product_combination_title'])) { | 
            
                                                                        
                            
            
                                    
            
            
                | 89 |  |  |                     $productCombinationTitle = array(); | 
            
                                                                        
                            
            
                                    
            
            
                | 90 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 91 |  |  |                     foreach ($product['attributes']['product_combination_title'] as $key => $val) { | 
            
                                                                        
                            
            
                                    
            
            
                | 92 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 93 |  |  |                         $productCombinationTitle[] = $key.': '.$val; | 
            
                                                                        
                            
            
                                    
            
            
                | 94 |  |  |                     } | 
            
                                                                        
                            
            
                                    
            
            
                | 95 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 96 |  |  |                     $newProduct['product_attribute_title'] = implode(', ', $productCombinationTitle); | 
            
                                                                        
                            
            
                                    
            
            
                | 97 |  |  |                  | 
            
                                                                        
                            
            
                                    
            
            
                | 98 |  |  |                 } | 
            
                                                                        
                            
            
                                    
            
            
                | 99 |  |  |             } | 
            
                                                                        
                            
            
                                    
            
            
                | 100 |  |  |             $modelProduct = $this->getProductModel(); | 
            
                                                                        
                            
            
                                    
            
            
                | 101 |  |  |             $newProducts[] = new $modelProduct($newProduct); | 
            
                                                                        
                            
            
                                    
            
            
                | 102 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 103 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 104 |  |  |         $orderModel->products()->saveMany($newProducts); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 105 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 106 |  |  |         return $orderModel; | 
            
                                                                        
                            
            
                                    
            
            
                | 107 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 108 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 109 |  |  |     public function createOrderFrontend(array $attributes, $shopId, $noAccountUser) | 
            
                                                                        
                            
            
                                    
            
            
                | 110 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 111 |  |  |         $attributes['shop_id'] = $shopId; | 
            
                                                                        
                            
            
                                    
            
            
                | 112 |  |  |         $attributes['client_id'] = $attributes['user_id']; | 
            
                                                                        
                            
            
                                    
            
            
                | 113 |  |  |         $client  = ClientService::selectOneByShopIdAndId($shopId, $attributes['user_id']); | 
            
                                                                        
                            
            
                                    
            
            
                | 114 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 115 |  |  |         $this->repo->getModel()->fill($attributes); | 
            
                                                                        
                            
            
                                    
            
            
                | 116 |  |  |         $this->repo->getModel()->save(); | 
            
                                                                        
                            
            
                                    
            
            
                | 117 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 118 |  |  |         if (!Cart::getContent()->count()) { | 
            
                                                                        
                            
            
                                    
            
            
                | 119 |  |  |             return false; | 
            
                                                                        
                            
            
                                    
            
            
                | 120 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 121 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 122 |  |  |         $this->addProducts($this->repo->getModel(), Cart::getContent()); | 
            
                                                                        
                            
            
                                    
            
            
                | 123 |  |  |          | 
            
                                                                        
                            
            
                                    
            
            
                | 124 |  |  |         if ($client) { | 
            
                                                                        
                            
            
                                    
            
            
                | 125 |  |  |             if ($client->clientDeliveryAddress) { | 
            
                                                                        
                            
            
                                    
            
            
                | 126 |  |  |                 $deliveryOrderAddress = $this->createAddress($client->clientDeliveryAddress->toArray(), $this->repo->getModel()->id); | 
            
                                                                        
                            
            
                                    
            
            
                | 127 |  |  |             } | 
            
                                                                        
                            
            
                                    
            
            
                | 128 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 129 |  |  |             if ($client->clientBillAddress) { | 
            
                                                                        
                            
            
                                    
            
            
                | 130 |  |  |                 $billOrderAddress = $this->createAddress($client->clientBillAddress->toArray(), $this->repo->getModel()->id); | 
            
                                                                        
                            
            
                                    
            
            
                | 131 |  |  |             } | 
            
                                                                        
                            
            
                                    
            
            
                | 132 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 133 |  |  |             $this->repo->getModel()->fill(array('delivery_order_address_id' => $deliveryOrderAddress->id, 'bill_order_address_id' => $billOrderAddress->id)); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                            
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 134 |  |  |             $this->repo->getModel()->save(); | 
            
                                                                        
                            
            
                                    
            
            
                | 135 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 136 |  |  |         } elseif ($noAccountUser) { | 
            
                                                                        
                            
            
                                    
            
            
                | 137 |  |  |             if (isset($noAccountUser['delivery'])) { | 
            
                                                                        
                            
            
                                    
            
            
                | 138 |  |  |                 $deliveryOrderAddress = $billOrderAddress = $this->createAddress($noAccountUser['delivery'], $this->repo->getModel()->id); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 139 |  |  |             } else { | 
            
                                                                        
                            
            
                                    
            
            
                | 140 |  |  |                 $deliveryOrderAddress = $billOrderAddress = $this->createAddress($noAccountUser, $this->repo->getModel()->id); | 
            
                                                                        
                            
            
                                    
            
            
                | 141 |  |  |             } | 
            
                                                                        
                            
            
                                    
            
            
                | 142 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 143 |  |  |             $billOrderAddress = $billOrderAddress = $this->createAddress($noAccountUser, $this->repo->getModel()->id); | 
            
                                                                        
                            
            
                                    
            
            
                | 144 |  |  |             $this->repo->getModel()->fill(array('delivery_order_address_id' => $deliveryOrderAddress->id, 'bill_order_address_id' => $billOrderAddress->id)); | 
            
                                                                        
                            
            
                                    
            
            
                | 145 |  |  |             $this->repo->getModel()->save(); | 
            
                                                                        
                            
            
                                    
            
            
                | 146 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 147 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 148 |  |  |         if (Cart::getConditionsByType('sending_method')->count()) { | 
            
                                                                        
                            
            
                                    
            
            
                | 149 |  |  |             $attributes = Cart::getConditionsByType('sending_method')->first()->getAttributes(); | 
            
                                                                        
                            
            
                                    
            
            
                | 150 |  |  |             $sendingMethod = SendingMethodService::find($attributes['data']['id']); | 
            
                                                                        
                            
            
                                    
            
            
                | 151 |  |  |             $price = $sendingMethod->getPriceDetails(); | 
            
                                                                        
                            
            
                                    
            
            
                | 152 |  |  |             $sendingMethodArray = $sendingMethod->toArray(); | 
            
                                                                        
                            
            
                                    
            
            
                | 153 |  |  |             $sendingMethodArray['price_with_tax'] = Cart::getConditionsByType('sending_method')->first()->getAttributes()['data']['price_details']['original_price_inc_tax']; | 
            
                                                                        
                            
            
                                    
            
            
                | 154 |  |  |             $sendingMethodArray['price_without_tax'] = Cart::getConditionsByType('sending_method')->first()->getAttributes()['data']['price_details']['original_price_ex_tax']; | 
            
                                                                        
                            
            
                                    
            
            
                | 155 |  |  |             $sendingMethodArray['tax_rate'] = $price['tax_rate']; | 
            
                                                                        
                            
            
                                    
            
            
                | 156 |  |  |             $sendingMethodArray['sending_method_id'] = $sendingMethod->id; | 
            
                                                                        
                            
            
                                    
            
            
                | 157 |  |  |             $sendingMethodArray['order_id'] = $this->repo->getModel()->id; | 
            
                                                                        
                            
            
                                    
            
            
                | 158 |  |  |             $orderSendingMethod = $this->getSendingMethodModel()->fill($sendingMethodArray); | 
            
                                                                        
                            
            
                                    
            
            
                | 159 |  |  |             $orderSendingMethod = $orderSendingMethod->save(); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 160 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 161 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 162 |  |  |         if (Cart::getConditionsByType('payment_method')->count()) { | 
            
                                                                        
                            
            
                                    
            
            
                | 163 |  |  |             $attributes = Cart::getConditionsByType('payment_method')->first()->getAttributes(); | 
            
                                                                        
                            
            
                                    
            
            
                | 164 |  |  |             $paymentMethod = PaymentMethodService::find($attributes['data']['id']); | 
            
                                                                        
                            
            
                                    
            
            
                | 165 |  |  |             $price = $paymentMethod->getPriceDetails(); | 
            
                                                                        
                            
            
                                    
            
            
                | 166 |  |  |             $paymentMethodArray = $paymentMethod->toArray(); | 
            
                                                                        
                            
            
                                    
            
            
                | 167 |  |  |             $paymentMethodArray['price_with_tax'] = Cart::getConditionsByType('payment_method')->first()->getAttributes()['data']['value_inc_tax']; | 
            
                                                                        
                            
            
                                    
            
            
                | 168 |  |  |             $paymentMethodArray['price_without_tax'] = Cart::getConditionsByType('payment_method')->first()->getAttributes()['data']['value_ex_tax']; | 
            
                                                                        
                            
            
                                    
            
            
                | 169 |  |  |             $paymentMethodArray['tax_rate'] = $price['tax_rate']; | 
            
                                                                        
                            
            
                                    
            
            
                | 170 |  |  |             $paymentMethodArray['payment_method_id'] = $paymentMethod->id; | 
            
                                                                        
                            
            
                                    
            
            
                | 171 |  |  |             $paymentMethodArray['order_id'] = $this->repo->getModel()->id; | 
            
                                                                        
                            
            
                                    
            
            
                | 172 |  |  |             $orderPaymentMethod = $this->getPaymentMethodModel()->fill($paymentMethodArray); | 
            
                                                                        
                            
            
                                    
            
            
                | 173 |  |  |             $orderPaymentMethod = $orderPaymentMethod->save(); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 174 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 175 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 176 |  |  |         if ($this->repo->getModel()->orderPaymentMethod->paymentMethod->order_confirmed_order_status_id) { | 
            
                                                                        
                            
            
                                    
            
            
                | 177 |  |  |             $this->repo->getModel()->fill(array('order_status_id' => $this->repo->getModel()->orderPaymentMethod->paymentMethod->order_confirmed_order_status_id)); | 
            
                                                                        
                            
            
                                    
            
            
                | 178 |  |  |             $this->repo->getModel()->save(); | 
            
                                                                        
                            
            
                                    
            
            
                | 179 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 180 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 181 |  |  |         return $this->repo->getModel(); | 
            
                                                                        
                            
            
                                    
            
            
                | 182 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 183 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 184 |  |  |     public function getProductModel() | 
            
                                                                        
                            
            
                                    
            
            
                | 185 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 186 |  |  |         return $this->repo->getProductModel(); | 
            
                                                                        
                            
            
                                    
            
            
                | 187 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 188 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 189 |  |  |     public function getAddressModel() | 
            
                                                                        
                            
            
                                    
            
            
                | 190 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 191 |  |  |         return $this->repo->getAddressModel(); | 
            
                                                                        
                            
            
                                    
            
            
                | 192 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 193 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 194 |  |  |     public function getSendingMethodModel() | 
            
                                                                        
                            
            
                                    
            
            
                | 195 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 196 |  |  |         return $this->repo->getOrderSendingMethodModel(); | 
            
                                                                        
                            
            
                                    
            
            
                | 197 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 198 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |     public function getPaymentMethodModel() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |     { | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 201 |  |  |         return $this->repo->getOrderPaymentMethodModel(); | 
            
                                                                        
                            
            
                                    
            
            
                | 202 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 203 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |     public function updateStatus($id, $orderStatusId) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |         $model = $this->find($id); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |         $attributes['order_status_id'] = $orderStatusId; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |         if (count($attributes) > 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |             $model->fill($attributes); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 |  |  |             $model->save(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 214 |  |  |         return $model; | 
            
                                                                        
                                                                
            
                                    
            
            
                | 215 |  |  |     } | 
            
                                                                        
                                                                
            
                                    
            
            
                | 216 |  |  | } | 
            
                        
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths