@@ 378-386 (lines=9) @@ | ||
375 | ||
376 | $c = count($stockMovements); |
|
377 | ||
378 | if ($c) { |
|
379 | $this->logger->emergency('There are '.$c.' stock movements with invalid bar codes'); |
|
380 | $productNumbers = []; |
|
381 | foreach ($stockMovements as $stockMovement) { |
|
382 | $productNumbers[] = $stockMovement->getProduct()->getNumber(); |
|
383 | } |
|
384 | ||
385 | throw new InvalidBarCodeException('Products with invalid bar codes: '.join(', ', $productNumbers), $productNumbers); |
|
386 | } |
|
387 | } |
|
388 | ||
389 | /** |
|
@@ 405-413 (lines=9) @@ | ||
402 | ||
403 | $c = count($stockMovements); |
|
404 | ||
405 | if ($c) { |
|
406 | $this->logger->critical('There are '.$c.' stock movements with invalid vendor numbers'); |
|
407 | $productNumbers = []; |
|
408 | foreach ($stockMovements as $stockMovement) { |
|
409 | $productNumbers[] = $stockMovement->getProduct()->getNumber(); |
|
410 | } |
|
411 | ||
412 | throw new InvalidVendorNumberException('Products with invalid vendor numbers: '.join($productNumbers), $productNumbers); |
|
413 | } |
|
414 | } |
|
415 | ||
416 | protected function getFile(string $extension = 'csv'): \SplFileObject |