Skip to content

Commit

Permalink
CS fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
volha-pivavarchyk committed Nov 11, 2024
1 parent b232c01 commit b8cb0d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions Command/GenerateSampleDataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace MauticPlugin\CustomObjectsBundle\Command;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception;
use Doctrine\ORM\EntityManager;
use MauticPlugin\CustomObjectsBundle\Helper\RandomHelper;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -111,8 +111,6 @@ protected function execute(InputInterface $input, OutputInterface $output)

/**
* @return int[]
*
* @throws DBALException
*/
private function createCustomObjectsWithItems(): array
{
Expand Down Expand Up @@ -150,13 +148,16 @@ private function createCustomObjectsWithItems(): array
return [$coProductId, $cfPriceId, $coOrderId];
}

/**
* @throws Exception
*/
private function cleanupDB(): void
{
$query = 'delete from '.MAUTIC_TABLE_PREFIX.'leads where 1';
$this->connection->query($query);
$this->connection->executeQuery($query);

$query = 'delete from '.MAUTIC_TABLE_PREFIX.'custom_object where 1';
$this->connection->query($query);
$this->connection->executeQuery($query);
}

private function generateContact(int $coProductId, int $cfPriceId, int $coOrderId, int $priceLimit): void
Expand Down Expand Up @@ -220,9 +221,11 @@ private function generateProductRelations(int $contactId, int $coProductId, int
}

/**
* @param array<int|string, mixed> $row
*
* @return int Last inserted row ID
*
* @throws DBALException
* @throws Exception
*/
private function insertInto(string $table, array $row): int
{
Expand Down Expand Up @@ -253,7 +256,7 @@ function ($value) {
VALUES ($values)
";

$this->connection->query($query);
$this->connection->executeQuery($query);

return (int) $this->connection->lastInsertId();
}
Expand Down
4 changes: 2 additions & 2 deletions EventListener/ImportSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use MauticPlugin\CustomObjectsBundle\Provider\CustomItemRouteProvider;
use MauticPlugin\CustomObjectsBundle\Repository\CustomFieldRepository;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class ImportSubscriber implements EventSubscriberInterface
Expand Down Expand Up @@ -229,7 +229,7 @@ private function handleValidateOwner(array $matchedFields): ?int
*
* @param mixed[] $matchedFields
*/
private function handleValidateRequired(Form $form, int $customObjectId, array $matchedFields): void
private function handleValidateRequired(FormInterface $form, int $customObjectId, array $matchedFields): void
{
$requiredFields = $this->customFieldRepository->getRequiredCustomFieldsForCustomObject($customObjectId);

Expand Down

0 comments on commit b8cb0d7

Please sign in to comment.