Skip to content

Commit 62aa707

Browse files
volha-pivavarchykdongilbertts-navghanerohitp19rahuld-dev
authored
Update to 5.x (#338)
* PHPStan fix again * PHPStan * PHPStan * PHPStan * Update README.md * Remove PUT from the available item operations for the custom_objects endpoint. * as PUT method is removed we are using PATCH insted * fix segement filter issue in custom object * fix test cases * add code coverage * fix phpstan issue * fix failing test case * fixing patch request * skip setDefaultValuesForMissingFields for patch request * adding comment * updating note for implementation * Fix warnings in test suite for PHP8.0 upgrade * Remove unused import Co-authored-by: Saurabh Gupta <[email protected]> * check lead exist before link to custom item * fixed tests * adding tests * removed php8 only compatibal code * change warning type * correct message * changed warning type * fix tests * check for method exists and csfix * Add merge filter query * Remove const is defined check * Fix test case by adding config param * Add function to check if custom object filters are mergable * Revert CustomFieldFilterQueryBuilder * Update services * Add CustomObjectMergedFilterQueryBuilder * Use CustomObjectMergedFilterQueryBuilder * Check for custom item filter * Change merge filter logic * Make consts * Fix test cases * Test with custom_object_merge_filter param * Move test to appropriate class name * Rename test case * Rename test case * Revert unnecessary code * Remove union return type declaration in favour of PHP7.4 * Remove not exists in favour of negative filters * Fix contact not getting added when one segment filter is used * fix dependencies * add parent constructor call * remove duplicate dependencies; change deprecated methods * fix inserting variable into string * fix an event dispatching issue * fix import with contact ids * fix the allowed memory size exhausted issue * fix the inheritance model issue * Handling custom item links when merging contacts * Adding GH Actions config * Adding PHPSTAN Baseline for existing issues * Remove dead code flagged by Rector * Fixing PHPUNIT config * Debugging tests * PHPSTAN baseline for each PHP version * Fixing tests * Some tests require theofidry/alice-data-fixtures * Test gh-actions * tests.yaml update * PHPSTAN baseline (debug) update * Comment PHPUNIT TESTS * Comment Coverage Report step * skip test * skip test * revert * print commit id * Push commit to mc-cs * Push commit to mc-cs * Push commit to mc-cs * Push commit to mc-cs * Push commit to mc-cs * Push commit to mc-cs * static analysis add * Moving Install composer up and comment phpstan baseline * Upgrade php and mysql version * Uncoomment PHPSTAN step * comment phpstan * Debug: regenerating PHPSTAN baseline * Updating PHPSTAN baseline, enabling PHPSTAN check * Clearing up the baseline files to generate them from scratch * Running PHPSTAN with fresh baselines * Updating action versions to avoid NodeJS warnings * Removing the pull_request settings hoping the CI will run on the commit without merging to staging * Disabling composer cache as theofidry/alice-data-fixtures doesn't seem to be present * Would it help to run the commands separately? * Or lock the version? * The dependency must be also set in kernel. Let's skip the tests that need it for now * The coverage report contains whole Mautic. Testing something different * Fixing kernel class * Another attempt to resolve the kernel class issue * Do we need to set KERNEL_CLASS? * Check API request by the controller name * fix customobject fetch from typeoparatorprovider * split into 2 line * var name change * empty and neq operator fixed * pass true for $filterAlreadyNegated only from CustomFieldFilterQueryBuilder * CustomItemRelationQueryBuilderTestCase was not included within the test suite as its name didn't end with "Test" * Added functional tests for "not equal" and "empty" operators * adding KERNEL_CLASS * fixing test * fixing tests * Update Tests/Functional/Segment/Query/Filter/NegativeOperatorFilterQueryBuilderTest.php Co-authored-by: Avikarsha Saha <[email protected]> * enabling phpstan and fixed issues * I think composer install should run after install mautic * removed dependacy install after mautic installation * removed vendor from scanDirectories from neon file * added between/not between operator for date type field * fix sonar issue * add functional test case * fix syntax * fix issue for development branch failing * Adding inTheLast and inTheNext operator for dat and datetime type fields * Fixed CampaignConditionTest * phpstan-ignore * phpstan-ignore * Comments for workarounds * CS fixes * NegativeOperatorFilterQueryBuilderTest fixed * NegativeOperatorFilterQueryBuilderTest fixed * Update Helper/QueryFilterHelper.php Co-authored-by: Aarohi Prasad <[email protected]> * fixc s * fix date issue if empty/not empty filter is used * fixed UI for between op, test case WIP * fix phpstan * Functioning code and test case for custom item between query for numbers * better handling of types * php7.4 syntax * removed php 8 only syntax * added test case for where assertion * fix failing test case * removed extra parameter * syntax changes * Env variable MAUTIC_PROJECT_VERSION introduced * TypeError : str_starts_with() fixed * fix same for merged filter too * change variable names * fixed failing test * fix not beetween issue * skip for 4.4 * skip for 4.4 csfix * skip for 4.4 csfix * skip for 4.4 csfix * 7.4 syntax * stan fix * stan fix * stan fix * fixes phpstan * skip phpstan * removing ingnore comment * removing unnecessary array filter * Hide the new operators from campaign condition, leave them for segment fitlers * Fixing operators also for int field types * cast string * test * MAUT-11616 : Fix operators do not refresh after selecting a different type of field in campaign event (#356) * fix Operators do not refresh after selecting a different type of field * csfix * adding test which verify the data-operators attr is available * fix phpstan * fix tests * suggessions * MAUT-11617 : Campaign -> Condition -> Custom Object Field values : Date picker unavailable for Date type fields (#357) * fix Operators do not refresh after selecting a different type of field * csfix * adding test which verify the data-operators attr is available * fix phpstan * fix tests * datepicker for date and datetime fields * using const type for fieldType Co-authored-by: Miroslav Fedeleš <[email protected]> * suggessions * ifx value should not be empty after change operator --------- Co-authored-by: Miroslav Fedeleš <[email protected]> * Replaced logger with monolog.logger.mautic (#355) * MAUT-11515 : Custom object date segment filters should have have same operators than date custom field filters (#358) * added all date/datetime filters to custom oject date fields * check if getcontext is exist * Added new function instead changing old one * change if condition sequence * increase code coverage * skip test case if mrunning on mautic 4.4 * Maut 11460: Dynamic content in email builder filtered on custom object values (#352) * on replacement * fix test * test * test * test * fix * skiped for 4.4 * WIP * refining * test case * test refine * fix test case * fix test case * split lines * CR * unnecessary query remove * check isset * local cache * key with id * test cases * Update EventListener/TokenSubscriber.php Co-authored-by: John Linhart <[email protected]> * Update EventListener/TokenSubscriber.php Co-authored-by: John Linhart <[email protected]> * WIP * string concat * match logic for CO * test case * test case csfix * test case csfix * const * var in config * fix null case for datetime * cs fix * fix for select and multi select * for noraml lead field * test case * split line * test case * fix for like and select --------- Co-authored-by: Avikarsha Saha <[email protected]> Co-authored-by: John Linhart <[email protected]> * Update Entity/CustomFieldOption.php Co-authored-by: GuzmanBellon <[email protected]> * Fix EventDispatcher calling * Fix deprecated fetchColumn call * Use appropriate service to run a command in the test * Add #[AllowDynamicProperties] attribute to allow using dynamic properies * Fix tests of controllers * Fix test of controllers * Fix controller tests * Fix controller tests * Fix model tests * Fix listener tests * Fix Form tests * Fix controller tests * Fix repository tests * Fix functional tests * Fix functional tests * Add a required field to fixtures * Fix created objects for testing * Fix pagination * Remove commented code * MAUT-11383 : incorrect date value being calculating when the segment filter value is "yesterday" and operator is "gt" for date field (#359) * Fix custom parameter date issue * add more test case * Fix config after merging * Fix a variable name * Fix tests after merging * Update dependencies * Get the export directory using the config * CS fixing * Remove unnesessary constant definition * Fix tests * Use master request instead of deprecated * Change phpunit configuration * CS fixing * PHPstan fixes * PHPStan fixes some ORM deprecations * Add phpstan baseline * Fix rector issues * Update phpstan baseline * Fix rector issues * Fix tests after fixing rector failures * Fix rector failures * Temporary set a parameter to allow the pipeline to continue even if Rector fails * Remove the CI Rector's temporary setting * Fix rector issues * Add a CI setting to crate a writable directory --------- Co-authored-by: Don Gilbert <[email protected]> Co-authored-by: Donald Gilbert <[email protected]> Co-authored-by: Tejas Navghane <[email protected]> Co-authored-by: Rohit Pavaskar <[email protected]> Co-authored-by: rahuld-dev <[email protected]> Co-authored-by: Saurabh Gupta <[email protected]> Co-authored-by: Saurabh Gupta <[email protected]> Co-authored-by: Rahul Dhande <[email protected]> Co-authored-by: Himanshu Prajapati <[email protected]> Co-authored-by: John Linhart <[email protected]> Co-authored-by: John Linhart <[email protected]> Co-authored-by: aadarshjain-dev <[email protected]> Co-authored-by: fedys <[email protected]> Co-authored-by: Avikarsha Saha <[email protected]> Co-authored-by: Avikarsha Saha <[email protected]> Co-authored-by: Aarohi Prasad <[email protected]> Co-authored-by: GuzmanBellon <[email protected]>
1 parent 4f1a784 commit 62aa707

File tree

375 files changed

+14904
-6613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

375 files changed

+14904
-6613
lines changed

.github/workflows/tests.yml

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Mautic Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- staging # Main branch
7+
- '[0-9]+\.[0-9]+'
8+
- development
9+
- beta
10+
pull_request:
11+
12+
env:
13+
PLUGIN_DIR: plugins/CustomObjectsBundle # Same as extra.install-directory-name in composer.json
14+
15+
jobs:
16+
phpunit:
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
php-versions: ['8.0'] # The supported PHP versions
22+
db-types: ['mysql'] # can be: ['mysql', 'mariadb'] but not necessary for this plugin that does not add any DB schema
23+
mautic-versions: ['5.1'] # The supported Mautic versions
24+
25+
name: Tests on PHP ${{ matrix.php-versions }}, ${{ matrix.db-types }}, Mautic ${{ matrix.mautic-versions }}
26+
27+
services:
28+
database:
29+
image: ${{ matrix.db-types == 'mysql' && 'mysql:8.0' || 'mariadb:10.3' }}
30+
env:
31+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
32+
MYSQL_DATABASE: mautictest
33+
ports:
34+
- 3306
35+
options: >-
36+
--shm-size=2gb
37+
--name=${{ matrix.db-types }}
38+
--tmpfs=/var/lib/mysql
39+
--health-cmd="mysqladmin ping"
40+
--health-interval=10s
41+
--health-timeout=5s
42+
--health-retries=3
43+
44+
steps:
45+
- name: Checkout Mautic
46+
uses: actions/checkout@v4
47+
with:
48+
repository: mautic/mautic
49+
ref: ${{ matrix.mautic-versions }}
50+
51+
- name: Checkout this plugin
52+
uses: actions/checkout@v4
53+
with:
54+
path: ${{ env.PLUGIN_DIR }}
55+
56+
- name: Setup PHP, with composer and extensions
57+
uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: ${{ matrix.php-versions }}
60+
ini-values: -dpcov.enabled=0, pcov.directory=."
61+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql
62+
coverage: pcov
63+
64+
- name: add MySQL config file
65+
run: |
66+
mysqldump --version
67+
mysqldump --print-defaults
68+
cp .github/ci-files/.my.cnf ~/.my.cnf
69+
mysqldump --print-defaults
70+
71+
- name: Set SYMFONY_ENV to test
72+
run: |
73+
echo "SYMFONY_ENV=test" >> $GITHUB_ENV
74+
echo "MAUTIC_ENV=test" >> $GITHUB_ENV
75+
76+
- name: Install Composer dependencies
77+
run: |
78+
composer install
79+
80+
# - name: Get composer cache directory
81+
# id: composer-cache
82+
# run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
83+
84+
# - name: Cache composer dependencies
85+
# uses: actions/cache@v4
86+
# with:
87+
# path: ${{ steps.composer-cache.outputs.dir }}
88+
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
89+
# restore-keys: ${{ runner.os }}-composer-
90+
91+
- name: Install Mautic
92+
env:
93+
DB_PORT: ${{ job.services.database.ports[3306] }}
94+
run: |
95+
cp ./.github/ci-files/local.php ./app/config/local.php
96+
php bin/console mautic:install --force http://localhost
97+
98+
- name: Install Plugins
99+
env:
100+
DB_PORT: ${{ job.services.database.ports[3306] }}
101+
run: php bin/console mautic:plugins:install --env=dev
102+
103+
# - name: Run static analysis
104+
# env:
105+
# COMPOSER_ALLOW_SUPERUSER: 1
106+
# run: composer phpstan -- --no-progress
107+
108+
- name: Run Code Style check
109+
run: bin/php-cs-fixer fix ${{ env.PLUGIN_DIR }} --config=.php-cs-fixer.php -v --dry-run --show-progress=dots --diff
110+
111+
# - name: PHPSTAN - baseline (debug, enable if you need to regenerate baseline for all PHP versions)
112+
# run: bin/phpstan --configuration=${{ env.PLUGIN_DIR }}/phpstan.neon --generate-baseline=var/logs/phpstan-baseline-${{ matrix.php-versions }}.neon --allow-empty-baseline
113+
114+
- name: PHPSTAN
115+
run: bin/phpstan --configuration=${{ env.PLUGIN_DIR }}/phpstan.neon
116+
117+
- name: Rector
118+
run: composer rector -- --dry-run --no-progress-bar ${{ env.PLUGIN_DIR }}
119+
120+
- name: Twig Lint
121+
run: bin/console lint:twig ${{ env.PLUGIN_DIR }}
122+
123+
- name: Create writable directory
124+
run: mkdir -p ./media/files/temp && chmod -R 777 ./media/files/temp
125+
126+
- name: Run PHPUNIT tests
127+
env:
128+
DB_PORT: ${{ job.services.database.ports[3306] }}
129+
# run: XDEBUG_MODE=coverage APP_DEBUG=0 php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude="~tests|themes|vendor~" bin/phpunit -d memory_limit=1G --bootstrap vendor/autoload.php --configuration ${{ env.PLUGIN_DIR }}/phpunit.xml --coverage-clover=${{ env.PLUGIN_DIR }}/coverage.xml --coverage-text
130+
run: XDEBUG_MODE=coverage APP_DEBUG=0 php -dpcov.enabled=1 -dpcov.directory=. bin/phpunit -d memory_limit=1G --bootstrap vendor/autoload.php --configuration ${{ env.PLUGIN_DIR }}/phpunit.xml --filter=CustomObjectsBundle --coverage-clover=${{ env.PLUGIN_DIR }}/coverage.xml --coverage-text
131+
132+
# - name: Coverage report (debug)
133+
# run: cat ${{ env.PLUGIN_DIR }}/coverage.xml
134+
135+
# - name: Upload coverage report
136+
# if: ${{ matrix.php-versions == '8.0' && matrix.db-types == 'mysql' && matrix.mautic-versions == '4.4' }} # upload just once, change for your matrix
137+
# uses: codecov/codecov-action@v3
138+
# with:
139+
# token: ${{ secrets.CODECOV_TOKEN }}
140+
# fail_ci_if_error: true
141+
# working-directory: ${{ env.PLUGIN_DIR }}
142+
# verbose: true
143+
144+
- name: Upload logs as artifacts
145+
uses: actions/upload-artifact@v3
146+
with:
147+
name: mautic-logs
148+
path: var/logs/

Assets/js/custom-objects.js

+29-5
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ CustomObjects = {
4444
'id': valueField.attr('id'),
4545
'name': valueField.attr('name'),
4646
'autocomplete': valueField.attr('autocomplete'),
47-
'value': valueField.attr('value')
47+
'value': valueField.val()
4848
};
49+
const fieldType = selectedField.attr('data-field-type');
4950

5051
operatorSelect.empty();
5152

@@ -67,17 +68,40 @@ CustomObjects = {
6768
newValueField.append(
6869
mQuery("<option></option>")
6970
.attr('value', optionValue)
70-
.attr('selected', valueField.attr('value') == optionValue)
71+
.attr('selected', valueField.val() === optionValue)
7172
.text(options[optionValue])
7273
);
73-
};
74+
}
75+
}
76+
77+
if (fieldType === 'date') {
78+
newValueField.datetimepicker({
79+
timepicker: false,
80+
format: 'Y-m-d',
81+
lazyInit: true,
82+
validateOnBlur: false,
83+
allowBlank: true,
84+
scrollMonth: false,
85+
scrollInput: false,
86+
closeOnDateSelect: true
87+
});
88+
} else if (fieldType === 'datetime') {
89+
newValueField.datetimepicker({
90+
format: 'Y-m-d H:i',
91+
lazyInit: true,
92+
validateOnBlur: false,
93+
allowBlank: true,
94+
scrollMonth: false,
95+
scrollInput: false
96+
});
7497
}
7598

7699
if (isEmptyOperator) {
77-
newValueField.attr('readonly', true);
100+
newValueField.val(null);
78101
newValueField.attr('value', '');
102+
newValueField.attr('disabled', 'disabled');
79103
} else {
80-
newValueField.attr('value', valueFieldAttrs['value']);
104+
newValueField.val(valueField.val());
81105
}
82106

83107
newValueField.attr(valueFieldAttrs);

Command/CustomItemsScheduledExportCommand.php

+8-17
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
namespace MauticPlugin\CustomObjectsBundle\Command;
66

7-
use Mautic\CoreBundle\Helper\ExitCode;
8-
use Mautic\CoreBundle\Templating\Helper\FormatterHelper;
7+
use Mautic\CoreBundle\Twig\Helper\FormatterHelper;
98
use MauticPlugin\CustomObjectsBundle\CustomItemEvents;
109
use MauticPlugin\CustomObjectsBundle\Event\CustomItemExportSchedulerEvent;
1110
use MauticPlugin\CustomObjectsBundle\Model\CustomItemExportSchedulerModel;
@@ -19,19 +18,11 @@ class CustomItemsScheduledExportCommand extends Command
1918
{
2019
public const COMMAND_NAME = 'mautic:custom_items:scheduled_export';
2120

22-
private CustomItemExportSchedulerModel $customItemExportSchedulerModel;
23-
private EventDispatcherInterface $eventDispatcher;
24-
private FormatterHelper $formatterHelper;
25-
2621
public function __construct(
27-
CustomItemExportSchedulerModel $customItemExportSchedulerModel,
28-
EventDispatcherInterface $eventDispatcher,
29-
FormatterHelper $formatterHelper
22+
private CustomItemExportSchedulerModel $customItemExportSchedulerModel,
23+
private EventDispatcherInterface $eventDispatcher,
24+
private FormatterHelper $formatterHelper
3025
) {
31-
$this->customItemExportSchedulerModel = $customItemExportSchedulerModel;
32-
$this->eventDispatcher = $eventDispatcher;
33-
$this->formatterHelper = $formatterHelper;
34-
3526
parent::__construct();
3627
}
3728

@@ -58,14 +49,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5849

5950
foreach ($customItemExportSchedulers as $customItemExportScheduler) {
6051
$customItemExportSchedulerEvent = new CustomItemExportSchedulerEvent($customItemExportScheduler);
61-
$this->eventDispatcher->dispatch(CustomItemEvents::CUSTOM_ITEM_PREPARE_EXPORT_FILE, $customItemExportSchedulerEvent);
62-
$this->eventDispatcher->dispatch(CustomItemEvents::CUSTOM_ITEM_MAIL_EXPORT_FILE, $customItemExportSchedulerEvent);
63-
$this->eventDispatcher->dispatch(CustomItemEvents::POST_EXPORT_MAIL_SENT, $customItemExportSchedulerEvent);
52+
$this->eventDispatcher->dispatch($customItemExportSchedulerEvent, CustomItemEvents::CUSTOM_ITEM_PREPARE_EXPORT_FILE);
53+
$this->eventDispatcher->dispatch($customItemExportSchedulerEvent, CustomItemEvents::CUSTOM_ITEM_MAIL_EXPORT_FILE);
54+
$this->eventDispatcher->dispatch($customItemExportSchedulerEvent, CustomItemEvents::POST_EXPORT_MAIL_SENT);
6455
++$count;
6556
}
6657

6758
$output->writeln('CustomItem export email(s) sent: '.$count);
6859

69-
return ExitCode::SUCCESS;
60+
return Command::SUCCESS;
7061
}
7162
}

Command/GenerateSampleDataCommand.php

+16-31
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,28 @@
55
namespace MauticPlugin\CustomObjectsBundle\Command;
66

77
use Doctrine\DBAL\Connection;
8-
use Doctrine\DBAL\DBALException;
8+
use Doctrine\DBAL\Exception;
99
use Doctrine\ORM\EntityManager;
1010
use MauticPlugin\CustomObjectsBundle\Helper\RandomHelper;
11-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
11+
use Symfony\Component\Console\Command\Command;
1212
use Symfony\Component\Console\Helper\ProgressBar;
1313
use Symfony\Component\Console\Input\InputInterface;
1414
use Symfony\Component\Console\Input\InputOption;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Question\ConfirmationQuestion;
1717
use Symfony\Component\Console\Style\SymfonyStyle;
1818

19-
class GenerateSampleDataCommand extends ContainerAwareCommand
19+
class GenerateSampleDataCommand extends Command
2020
{
21-
/**
22-
* @var EntityManager
23-
*/
24-
private $entityManager;
25-
26-
/**
27-
* @var RandomHelper
28-
*/
29-
private $randomHelper;
30-
31-
/**
32-
* @var Connection
33-
*/
34-
private $connection;
21+
private Connection $connection;
3522

3623
public function __construct(
37-
EntityManager $entityManager,
38-
RandomHelper $randomHelper
24+
private EntityManager $entityManager,
25+
private RandomHelper $randomHelper
3926
) {
4027
parent::__construct();
4128

42-
$this->entityManager = $entityManager;
43-
$this->randomHelper = $randomHelper;
44-
$this->connection = $entityManager->getConnection();
29+
$this->connection = $entityManager->getConnection();
4530
}
4631

4732
/**
@@ -111,8 +96,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
11196

11297
/**
11398
* @return int[]
114-
*
115-
* @throws DBALException
11699
*/
117100
private function createCustomObjectsWithItems(): array
118101
{
@@ -150,13 +133,16 @@ private function createCustomObjectsWithItems(): array
150133
return [$coProductId, $cfPriceId, $coOrderId];
151134
}
152135

136+
/**
137+
* @throws Exception
138+
*/
153139
private function cleanupDB(): void
154140
{
155141
$query = 'delete from '.MAUTIC_TABLE_PREFIX.'leads where 1';
156-
$this->connection->query($query);
142+
$this->connection->executeQuery($query);
157143

158144
$query = 'delete from '.MAUTIC_TABLE_PREFIX.'custom_object where 1';
159-
$this->connection->query($query);
145+
$this->connection->executeQuery($query);
160146
}
161147

162148
private function generateContact(int $coProductId, int $cfPriceId, int $coOrderId, int $priceLimit): void
@@ -220,9 +206,11 @@ private function generateProductRelations(int $contactId, int $coProductId, int
220206
}
221207

222208
/**
209+
* @param array<int|string, mixed> $row
210+
*
223211
* @return int Last inserted row ID
224212
*
225-
* @throws DBALException
213+
* @throws Exception
226214
*/
227215
private function insertInto(string $table, array $row): int
228216
{
@@ -235,13 +223,10 @@ function ($value) {
235223
switch (gettype($value)) {
236224
case 'string':
237225
return "'$value'";
238-
break;
239226
case 'integer':
240227
return (string) $value;
241-
break;
242228
case 'boolean':
243229
return (bool) $value;
244-
break;
245230
default:
246231
$type = gettype($value);
247232
throw new \InvalidArgumentException("Unsupported type '$type' for insert query");
@@ -256,7 +241,7 @@ function ($value) {
256241
VALUES ($values)
257242
";
258243

259-
$this->connection->query($query);
244+
$this->connection->executeQuery($query);
260245

261246
return (int) $this->connection->lastInsertId();
262247
}

0 commit comments

Comments
 (0)