Improved code style of tests

This commit is contained in:
Jan Böhmer 2023-06-11 15:02:59 +02:00
parent 5629215ce4
commit 684334ba22
73 changed files with 196 additions and 38 deletions

View file

@ -8,6 +8,9 @@ use App\Entity\Parts\PartLot;
use App\Services\LogSystem\EventCommentHelper;
use App\Services\LogSystem\EventLogger;
/**
* @see \App\Tests\Services\Parts\PartLotWithdrawAddHelperTest
*/
final class PartLotWithdrawAddHelper
{
public function __construct(private readonly EventLogger $eventLogger, private readonly EventCommentHelper $eventCommentHelper)

View file

@ -32,6 +32,9 @@ use Locale;
use function count;
/**
* @see \App\Tests\Services\Parts\PricedetailHelperTest
*/
class PricedetailHelper
{
protected string $locale;
@ -54,7 +57,7 @@ class PricedetailHelper
foreach ($orderdetails as $orderdetail) {
$pricedetails = $orderdetail->getPricedetails();
//The orderdetail must have pricedetails, otherwise this will not work!
if (0 === count($pricedetails)) {
if (0 === (is_countable($pricedetails) ? count($pricedetails) : 0)) {
continue;
}
@ -99,7 +102,7 @@ class PricedetailHelper
foreach ($orderdetails as $orderdetail) {
$pricedetails = $orderdetail->getPricedetails();
//The orderdetail must have pricedetails, otherwise this will not work!
if (0 === count($pricedetails)) {
if (0 === (is_countable($pricedetails) ? count($pricedetails) : 0)) {
continue;
}