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

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
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

_build/test/MODxControllerTestCase.php

Lines changed: 4 additions & 2 deletions
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
}

_build/test/MODxTestCase.php

Lines changed: 3 additions & 2 deletions
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

_build/test/Tests/Cases/Request/MakeUrlTest.php

Lines changed: 4 additions & 2 deletions
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'));

_build/test/Tests/Controllers/Context/ContextUpdateControllerTest.php

Lines changed: 2 additions & 1 deletion
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
}

_build/test/Tests/Controllers/DeprecatedControllerTest.php

Lines changed: 4 additions & 2 deletions
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
}

_build/test/Tests/Controllers/WelcomeControllerTest.php

Lines changed: 4 additions & 2 deletions
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 */

_build/test/Tests/Model/Dashboard/modDashboardTest.php

Lines changed: 2 additions & 1 deletion
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);

_build/test/Tests/Model/Dashboard/modDashboardWidgetTest.php

Lines changed: 2 additions & 1 deletion
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');

_build/test/Tests/Model/Element/modChunkTest.php

Lines changed: 4 additions & 2 deletions
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
}

0 commit comments

Comments
 (0)