@@ 312-320 (lines=9) @@ | ||
309 | ||
310 | $c = count($stockMovements); |
|
311 | ||
312 | if($c) { |
|
313 | $this->logger->emergency('There are '.$c.' stock movements with invalid bar codes'); |
|
314 | $productNumbers = []; |
|
315 | foreach ($stockMovements as $stockMovement) { |
|
316 | $productNumbers[] = $stockMovement->getProduct()->getNumber(); |
|
317 | } |
|
318 | ||
319 | throw new InvalidBarCodeException('Products with invalid bar codes: '.join(', ', $productNumbers), $productNumbers); |
|
320 | } |
|
321 | } |
|
322 | ||
323 | /** |
|
@@ 339-347 (lines=9) @@ | ||
336 | ||
337 | $c = count($stockMovements); |
|
338 | ||
339 | if($c) { |
|
340 | $this->logger->critical('There are '.$c.' stock movements with invalid vendor numbers'); |
|
341 | $productNumbers = []; |
|
342 | foreach ($stockMovements as $stockMovement) { |
|
343 | $productNumbers[] = $stockMovement->getProduct()->getNumber(); |
|
344 | } |
|
345 | ||
346 | throw new InvalidVendorNumberException('Products with invalid vendor numbers: '.join($productNumbers), $productNumbers); |
|
347 | } |
|
348 | } |
|
349 | ||
350 | protected function getFile(string $extension = 'csv') : \SplFileObject |