Skip to content

Commit e9c69ba

Browse files
committed
PHP 8.4 compatibility updates
1 parent a4e3c9f commit e9c69ba

Some content is hidden

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

51 files changed

+163
-97
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
strategy:
3131
matrix:
32-
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3']
32+
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
3333

3434
steps:
3535
- name: Checkout

Diff for: _build/test/MODxControllerTestCase.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ abstract class MODxControllerTestCase extends MODxTestCase {
3030
*/
3131
public $controllerName;
3232

33-
public function setUp() {
33+
public function setUp(): void
34+
{
3435
parent::setUp();
3536

3637
/* load smarty template engine */
@@ -57,7 +58,8 @@ public function setUp() {
5758
}
5859
}
5960

60-
public function tearDown() {
61+
public function tearDown(): void
62+
{
6163
parent::tearDown();
6264
$this->controller = null;
6365
}

Diff for: _build/test/MODxTestCase.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ abstract class MODxTestCase extends \PHPUnit\Framework\TestCase {
2828
/**
2929
* Ensure all tests have a reference to the MODX object
3030
*/
31-
public function setUp() {
31+
public function setUp(): void
32+
{
3233
$this->modx =& MODxTestHarness::getFixture('modX', 'modx');
3334
if ($this->modx->request) {
3435
$this->modx->request->loadErrorHandler();
@@ -43,7 +44,7 @@ public function setUp() {
4344
/**
4445
* Remove reference at end of test case
4546
*/
46-
public function tearDown() {}
47+
public function tearDown(): void {}
4748

4849
/**
4950
* Check a MODX return result for a success flag

Diff for: _build/test/Tests/Cases/Request/MakeUrlTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* @group MakeUrl
2020
*/
2121
class MakeUrlTest extends MODxTestCase {
22-
public function setUp() {
22+
public function setUp(): void
23+
{
2324
parent::setUp();
2425

2526
/** @var modResource $resource */
@@ -82,7 +83,8 @@ public function setUp() {
8283
//$this->modx->context->prepare(true);
8384
$this->modx->context->aliasMap = null;
8485
}
85-
public function tearDown() {
86+
public function tearDown(): void
87+
{
8688
parent::tearDown();
8789
/** @var modResource $resource */
8890
$resource = $this->modx->getObject('modResource',array('pagetitle' => 'Unit Test Resource'));

Diff for: _build/test/Tests/Controllers/Context/ContextUpdateControllerTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class ContextUpdateControllerTest extends MODxControllerTestCase {
2626
public $controllerName = 'ContextUpdateManagerController';
2727
public $controllerPath = 'context/update';
2828

29-
public function setUp() {
29+
public function setUp(): void
30+
{
3031
parent::setUp();
3132
$this->controller->setProperty('key','web');
3233
}

Diff for: _build/test/Tests/Controllers/DeprecatedControllerTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ class DeprecatedControllerTest extends MODxTestCase {
99
*/
1010
public $controller;
1111

12-
public function setUp() {
12+
public function setUp(): void
13+
{
1314
parent::setUp();
1415

1516
$this->controller = new modManagerControllerDeprecated($this->modx);
1617
}
17-
public function tearDown() {
18+
public function tearDown(): void
19+
{
1820
parent::tearDown();
1921
$this->controller = null;
2022
}

Diff for: _build/test/Tests/Controllers/WelcomeControllerTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class WelcomeControllerTest extends MODxControllerTestCase {
2525
public $controllerName = 'WelcomeManagerController';
2626
public $controllerPath = 'welcome';
2727

28-
public function setUp() {
28+
public function setUp(): void
29+
{
2930
parent::setUp();
3031

3132
/** @var modDashboard $dashboard */
@@ -71,7 +72,8 @@ public function setUp() {
7172

7273
}
7374

74-
public function tearDown() {
75+
public function tearDown(): void
76+
{
7577
parent::tearDown();
7678
$userGroups = $this->modx->getCollection('modUserGroup',array('name:LIKE' => '%Unit Test%'));
7779
/** @var modUserGroup $userGroup */

Diff for: _build/test/Tests/Model/Dashboard/modDashboardTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class modDashboardTest extends MODxTestCase {
2424
* Load some utility classes this case uses
2525
* @return void
2626
*/
27-
public function setUp() {
27+
public function setUp(): void
28+
{
2829
parent::setUp();
2930
$this->modx->loadClass('modDashboard');
3031
$this->modx->loadClass('modManagerController',MODX_CORE_PATH.'model/modx/',true,true);

Diff for: _build/test/Tests/Model/Dashboard/modDashboardWidgetTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class modDashboardWidgetTest extends MODxTestCase {
2626
* Load some utility classes this case uses
2727
* @return void
2828
*/
29-
public function setUp() {
29+
public function setUp(): void
30+
{
3031
parent::setUp();
3132
$this->modx->loadClass('modDashboard');
3233
$this->modx->loadClass('modDashboardWidget');

Diff for: _build/test/Tests/Model/Element/modChunkTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class modChunkTest extends MODxTestCase {
2525
/** @var modChunk $chunk */
2626
public $chunk;
2727

28-
public function setUp() {
28+
public function setUp(): void
29+
{
2930
parent::setUp();
3031
$this->chunk = $this->modx->newObject('modChunk');
3132
$this->chunk->fromArray(array(
@@ -39,7 +40,8 @@ public function setUp() {
3940
$this->chunk->setProperties(array('name' => 'John'));
4041
$this->chunk->setCacheable(false);
4142
}
42-
public function tearDown() {
43+
public function tearDown(): void
44+
{
4345
parent::tearDown();
4446
$this->chunk = null;
4547
}

Diff for: _build/test/Tests/Model/Element/modPluginTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class modPluginTest extends MODxTestCase {
2525
/** @var modPlugin $plugin */
2626
public $plugin;
2727

28-
public function setUp() {
28+
public function setUp(): void
29+
{
2930
parent::setUp();
3031
$this->plugin = $this->modx->newObject('modPlugin');
3132
$this->plugin->fromArray(array(
@@ -40,7 +41,8 @@ public function setUp() {
4041
$this->plugin->setProperties(array('name' => 'John'));
4142
$this->plugin->setCacheable(false);
4243
}
43-
public function tearDown() {
44+
public function tearDown(): void
45+
{
4446
parent::tearDown();
4547
$this->plugin = null;
4648
}

Diff for: _build/test/Tests/Model/Element/modSnippetTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class modSnippetTest extends MODxTestCase {
2525
/** @var modSnippet $snippet */
2626
public $snippet;
2727

28-
public function setUp() {
28+
public function setUp(): void
29+
{
2930
parent::setUp();
3031
$this->snippet = $this->modx->newObject('modSnippet');
3132
$this->snippet->fromArray(array(
@@ -40,7 +41,8 @@ public function setUp() {
4041
$this->snippet->save();
4142
$this->modx->event= new modSystemEvent();
4243
}
43-
public function tearDown() {
44+
public function tearDown(): void
45+
{
4446
parent::tearDown();
4547
$this->snippet->remove();
4648
$this->snippet = null;

Diff for: _build/test/Tests/Model/Element/modTagTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
* @group modTag
2121
*/
2222
class modTagTest extends MODxTestCase {
23-
public static function setUpBeforeClass() {
23+
public static function setUpBeforeClass(): void
24+
{
2425
$modx =& MODxTestHarness::getFixture('modX', 'modx');
2526
include dirname(__FILE__) . '/modtagelement.mock.php';
2627
}

Diff for: _build/test/Tests/Model/Element/modTemplateTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class modTemplateTest extends MODxTestCase {
2424
/** @var modTemplate $template */
2525
public $template;
2626

27-
public function setUp() {
27+
public function setUp(): void
28+
{
2829
parent::setUp();
2930
$this->template = $this->modx->newObject('modTemplate');
3031
$this->template->fromArray(array(
@@ -38,7 +39,8 @@ public function setUp() {
3839
$this->template->setProperties(array('name' => 'John'));
3940
$this->template->setCacheable(false);
4041
}
41-
public function tearDown() {
42+
public function tearDown(): void
43+
{
4244
parent::tearDown();
4345
$this->template = null;
4446
}

Diff for: _build/test/Tests/Model/Element/modTemplateVarTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class modTemplateVarTest extends MODxTestCase {
2424
/** @var modTemplateVar $tv */
2525
public $tv;
2626

27-
public function setUp() {
27+
public function setUp(): void
28+
{
2829
parent::setUp();
2930
$this->tv = $this->modx->newObject('modTemplateVar');
3031
$this->tv->fromArray(array(
@@ -39,7 +40,8 @@ public function setUp() {
3940
$this->tv->setProperties(array('name' => 'John'));
4041
$this->tv->setCacheable(false);
4142
}
42-
public function tearDown() {
43+
public function tearDown(): void
44+
{
4345
parent::tearDown();
4446
$this->tv = null;
4547
}

Diff for: _build/test/Tests/Model/Error/modErrorTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ class modErrorTest extends MODxTestCase {
2626
/**
2727
* Instantiate the modError instance for each test
2828
*/
29-
public function setUp() {
29+
public function setUp(): void
30+
{
3031
parent::setUp();
3132
$this->error = $this->modx->getService('error','error.modError');
3233
}
3334

3435
/**
3536
* Ensure that the error class is reset on each load
3637
*/
37-
public function tearDown() {
38+
public function tearDown(): void
39+
{
3840
parent::tearDown();
3941
$this->modx->services['error'] = null;
4042
$this->modx->error = null;

Diff for: _build/test/Tests/Model/Filters/modOutputFilterTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class modOutputFilterTest extends MODxTestCase {
2323
/** @var modPlaceholderTag $tag */
2424
public $tag;
2525

26-
public function setUp() {
26+
public function setUp(): void
27+
{
2728
parent::setUp();
2829
$this->modx->getParser();
2930
$this->tag = new modPlaceholderTag($this->modx);

Diff for: _build/test/Tests/Model/FormCustomization/modActionDomTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
* @group modActionDom
2121
*/
2222
class modActionDomTest extends MODxTestCase {
23-
public function setUp() {
23+
public function setUp(): void
24+
{
2425
parent::setUp();
2526
}
2627

Diff for: _build/test/Tests/Model/Lexicon/modLexiconTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ class modLexiconTest extends MODxTestCase {
2323
/** @var modLexicon $lexicon */
2424
public $lexicon;
2525

26-
public function setUp() {
26+
public function setUp(): void
27+
{
2728
parent::setUp();
2829
$this->modx->loadClass('modLexicon',null,true,true);
2930
$this->lexicon = new modLexicon($this->modx);
3031
}
3132

32-
public function tearDown() {
33+
public function tearDown(): void
34+
{
3335
$this->lexicon->clear();
3436
}
3537

Diff for: _build/test/Tests/Model/Mail/modMailTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class modMailTest extends MODxTestCase {
2525
*/
2626
public $mail;
2727

28-
public function setUp() {
28+
public function setUp(): void
29+
{
2930
parent::setUp();
3031
$this->modx->loadClass('mail.modMail',MODX_CORE_PATH.'model/modx/',true,true);
3132
$this->mail = $this->getMockForAbstractClass('modMail',array(&$this->modx));

Diff for: _build/test/Tests/Model/Registry/modFileRegisterTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
* @group modFileRegister
2222
*/
2323
class modFileRegisterTest extends MODxTestCase {
24-
public static function setUpBeforeClass() {
24+
public static function setUpBeforeClass(): void
25+
{
2526
/** @var modX $modx */
2627
$modx =& MODxTestHarness::getFixture('modX', 'modx');
2728
$modx->getService('registry', 'registry.modRegistry');
2829
$modx->registry->addRegister('register', 'registry.modFileRegister', array('directory' => 'register'));
2930
}
3031

31-
public static function tearDownAfterClass() {
32+
public static function tearDownAfterClass(): void
33+
{
3234
/** @var modX $modx */
3335
$modx =& MODxTestHarness::getFixture('modX', 'modx');
3436
$modx->getService('registry', 'registry.modRegistry');

Diff for: _build/test/Tests/Model/Registry/modRegisterTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
* @group modRegister
2121
*/
2222
class modRegisterTest extends MODxTestCase {
23-
public static function setUpBeforeClass() {
23+
public static function setUpBeforeClass(): void
24+
{
2425
/** @var modX $modx */
2526
$modx =& MODxTestHarness::getFixture('modX', 'modx');
2627
$modx->getService('registry', 'registry.modRegistry');
@@ -29,7 +30,8 @@ public static function setUpBeforeClass() {
2930
$modx->registry->addRegister('register', 'modMemoryRegister', array('directory' => 'register'));
3031
}
3132

32-
public static function tearDownAfterClass() {
33+
public static function tearDownAfterClass(): void
34+
{
3335
/** @var modX $modx */
3436
$modx =& MODxTestHarness::getFixture('modX', 'modx');
3537
$modx->getService('registry', 'registry.modRegistry');

Diff for: _build/test/Tests/Model/Registry/modRegistryTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
* @group modRegistry
2121
*/
2222
class modRegistryTest extends MODxTestCase {
23-
public static function setUpBeforeClass() {
23+
public static function setUpBeforeClass(): void
24+
{
2425
parent::setUpBeforeClass();
2526
$modx =& MODxTestHarness::getFixture('modX', 'modx');
2627
$modx->getService('registry', 'registry.modRegistry');

Diff for: _build/test/Tests/Model/Request/modRequestTest.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class modRequestTest extends MODxTestCase {
2626
/**
2727
* @return void
2828
*/
29-
public function setUp() {
29+
public function setUp(): void
30+
{
3031
parent::setUp();
3132
/** @var modNamespace $namespace */
3233
$namespace = $this->modx->newObject('modNamespace');
@@ -57,7 +58,8 @@ public function setUp() {
5758
/**
5859
* @return void
5960
*/
60-
public function tearDown() {
61+
public function tearDown(): void
62+
{
6163
parent::tearDown();
6264

6365
/** @var modNamespace $namespace */
@@ -317,9 +319,9 @@ public function providerSanitizeRequest() {
317319
array("MODX [[\$chunk? &property=`test`\n &across=`lines
318320
319321
`&test=1]] Tags",'MODX Tags'),
320-
array("Nested MODX [[test?
321-
&ids = `[[!getids
322-
&field=`id`
322+
array("Nested MODX [[test?
323+
&ids = `[[!getids
324+
&field=`id`
323325
&resource=`[[+resource]]`
324326
]]`
325327
&parents=`2`

0 commit comments

Comments
 (0)