Skip to content

Commit 1e15c8f

Browse files
authored
Merge branch 'mautic:main' into main
2 parents e92acc1 + 6890130 commit 1e15c8f

Some content is hidden

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

88 files changed

+154
-532
lines changed

.github/workflows/tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
services:
2424
mysql:
25-
image: mysql:5.7
25+
image: mysql:8.4
2626
env:
2727
MYSQL_ALLOW_EMPTY_PASSWORD: yes
2828
MYSQL_DATABASE: mautictest
@@ -49,7 +49,7 @@ jobs:
4949
- name: Setup PHP, with composer and extensions
5050
uses: shivammathur/setup-php@v2
5151
with:
52-
php-version: 8.1
52+
php-version: 8.3
5353
ini-values: session.save_handler=redis, session.save_path="tcp://127.0.0.1:6379"
5454
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql
5555
coverage: pcov
@@ -63,13 +63,13 @@ jobs:
6363
run: |
6464
sudo add-apt-repository ppa:ondrej/php -y
6565
sudo apt-get update
66-
sudo apt-get install apache2 libapache2-mod-php8.1
66+
sudo apt-get install apache2 libapache2-mod-php8.3
6767
sudo a2enmod rewrite
68-
sudo sed -i 's,^session.save_handler =.*$,session.save_handler = redis,' /etc/php/8.1/apache2/php.ini
69-
sudo sed -i 's,^;session.save_path =.*$,session.save_path = "tcp://127.0.0.1:6379",' /etc/php/8.1/apache2/php.ini
70-
sudo sed -i 's,^memory_limit =.*$,memory_limit = 256M,' /etc/php/8.1/apache2/php.ini
68+
sudo sed -i 's,^session.save_handler =.*$,session.save_handler = redis,' /etc/php/8.3/apache2/php.ini
69+
sudo sed -i 's,^;session.save_path =.*$,session.save_path = "tcp://127.0.0.1:6379",' /etc/php/8.3/apache2/php.ini
70+
sudo sed -i 's,^memory_limit =.*$,memory_limit = 256M,' /etc/php/8.3/apache2/php.ini
7171
sudo service apache2 restart
72-
cat /etc/php/8.1/apache2/php.ini | grep session
72+
cat /etc/php/8.3/apache2/php.ini | grep session
7373
7474
- name: Install dependencies
7575
run: |
@@ -159,7 +159,7 @@ jobs:
159159
- name: Setup PHP, with composer and extensions
160160
uses: shivammathur/setup-php@v2
161161
with:
162-
php-version: 8.1
162+
php-version: 8.3
163163
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql
164164

165165
- name: Install dependencies

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"require-dev": {
2626
"kint-php/kint": "^4.1",
27-
"friendsofphp/php-cs-fixer": "~3.12.0",
27+
"friendsofphp/php-cs-fixer": "^3.73",
2828
"phpunit/phpunit": "~9.5.0",
2929
"guzzlehttp/guzzle": "^7.5",
3030
"phpstan/phpstan": "^1.11"

lib/Api/Api.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2014 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -230,12 +231,12 @@ public function makeRequest($endpoint, array $parameters = [], $method = 'GET')
230231

231232
if (false === strpos($url, 'http')) {
232233
$error = [
233-
'code' => 500,
234-
'message' => sprintf(
235-
'URL is incomplete. Please use %s, set the base URL as the third argument to $MauticApi->newApi(), or make $endpoint a complete URL.',
236-
__CLASS__.'setBaseUrl()'
237-
),
238-
];
234+
'code' => 500,
235+
'message' => sprintf(
236+
'URL is incomplete. Please use %s, set the base URL as the third argument to $MauticApi->newApi(), or make $endpoint a complete URL.',
237+
__CLASS__.'setBaseUrl()'
238+
),
239+
];
239240
} else {
240241
try {
241242
$settings = [];
@@ -251,24 +252,24 @@ public function makeRequest($endpoint, array $parameters = [], $method = 'GET')
251252

252253
// assume an error
253254
$error = [
254-
'code' => 500,
255-
'message' => $response,
256-
];
255+
'code' => 500,
256+
'message' => $response,
257+
];
257258
}
258259
} catch (\Exception $e) {
259260
$this->getLogger()->error('Failed connecting to Mautic API: '.$e->getMessage(), ['trace' => $e->getTraceAsString()]);
260261

261262
$error = [
262-
'code' => $e->getCode(),
263-
'message' => $e->getMessage(),
264-
];
263+
'code' => $e->getCode(),
264+
'message' => $e->getMessage(),
265+
];
265266
}
266267
}
267268

268269
if (!empty($error)) {
269270
return [
270-
'errors' => [$error],
271-
];
271+
'errors' => [$error],
272+
];
272273
} elseif (!empty($response['errors'])) {
273274
$this->getLogger()->error('Mautic API returned errors: '.var_export($response['errors'], true));
274275
}

lib/Api/Assets.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2014 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -15,24 +16,12 @@
1516
*/
1617
class Assets extends Api
1718
{
18-
/**
19-
* {@inheritdoc}
20-
*/
2119
protected $endpoint = 'assets';
2220

23-
/**
24-
* {@inheritdoc}
25-
*/
2621
protected $listName = 'assets';
2722

28-
/**
29-
* {@inheritdoc}
30-
*/
3123
protected $itemName = 'asset';
3224

33-
/**
34-
* {@inheritdoc}
35-
*/
3625
protected $searchCommands = [
3726
'ids',
3827
'is:published',

lib/Api/CampaignEvents.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2016 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -15,19 +16,10 @@
1516
*/
1617
class CampaignEvents extends Api
1718
{
18-
/**
19-
* {@inheritdoc}
20-
*/
2119
protected $endpoint = 'campaigns/events';
2220

23-
/**
24-
* {@inheritdoc}
25-
*/
2621
protected $listName = 'events';
2722

28-
/**
29-
* {@inheritdoc}
30-
*/
3123
protected $itemName = 'event';
3224

3325
/**

lib/Api/Campaigns.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2014 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -15,19 +16,10 @@
1516
*/
1617
class Campaigns extends Api
1718
{
18-
/**
19-
* {@inheritdoc}
20-
*/
2119
protected $endpoint = 'campaigns';
2220

23-
/**
24-
* {@inheritdoc}
25-
*/
2621
protected $listName = 'campaigns';
2722

28-
/**
29-
* {@inheritdoc}
30-
*/
3123
protected $itemName = 'campaign';
3224

3325
/**
@@ -38,9 +30,6 @@ class Campaigns extends Api
3830
'campaigns/(.*?)/contact/(.*?)/remove' => 'campaigns/$1/contact/remove/$2', // 2.6.0
3931
];
4032

41-
/**
42-
* {@inheritdoc}
43-
*/
4433
protected $searchCommands = [
4534
'ids',
4635
'is:published',

lib/Api/Categories.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2014 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -15,24 +16,12 @@
1516
*/
1617
class Categories extends Api
1718
{
18-
/**
19-
* {@inheritdoc}
20-
*/
2119
protected $endpoint = 'categories';
2220

23-
/**
24-
* {@inheritdoc}
25-
*/
2621
protected $listName = 'categories';
2722

28-
/**
29-
* {@inheritdoc}
30-
*/
3123
protected $itemName = 'category';
3224

33-
/**
34-
* {@inheritdoc}
35-
*/
3625
protected $searchCommands = [
3726
'ids',
3827
'is:published',

lib/Api/Companies.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2014 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -15,19 +16,10 @@
1516
*/
1617
class Companies extends Api
1718
{
18-
/**
19-
* {@inheritdoc}
20-
*/
2119
protected $endpoint = 'companies';
2220

23-
/**
24-
* {@inheritdoc}
25-
*/
2621
protected $listName = 'companies';
2722

28-
/**
29-
* {@inheritdoc}
30-
*/
3123
protected $itemName = 'company';
3224

3325
/**
@@ -38,9 +30,6 @@ class Companies extends Api
3830
'companies/(.*?)/contact/(.*?)/remove' => 'companies/$1/contact/remove/$2', // 2.6.0
3931
];
4032

41-
/**
42-
* {@inheritdoc}
43-
*/
4433
protected $searchCommands = [
4534
'ids',
4635
'is:mine',

lib/Api/CompanyFields.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2014 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -15,18 +16,9 @@
1516
*/
1617
class CompanyFields extends Api
1718
{
18-
/**
19-
* {@inheritdoc}
20-
*/
2119
protected $endpoint = 'fields/company';
2220

23-
/**
24-
* {@inheritdoc}
25-
*/
2621
protected $listName = 'fields';
2722

28-
/**
29-
* {@inheritdoc}
30-
*/
3123
protected $itemName = 'field';
3224
}

lib/Api/ContactFields.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright 2014 Mautic, NP. All rights reserved.
45
* @author Mautic
@@ -15,18 +16,9 @@
1516
*/
1617
class ContactFields extends Api
1718
{
18-
/**
19-
* {@inheritdoc}
20-
*/
2119
protected $endpoint = 'fields/contact';
2220

23-
/**
24-
* {@inheritdoc}
25-
*/
2621
protected $listName = 'fields';
2722

28-
/**
29-
* {@inheritdoc}
30-
*/
3123
protected $itemName = 'field';
3224
}

0 commit comments

Comments
 (0)