Commit 12cd00a
PHP 8.4 compatibility fixes
Fixed all PHP 8.4 deprecation warnings while maintaining
PHP 8.2+ compatibility:
CRITICAL FIXES (deprecated in PHP 8.4):
1. Replaced get_class() without arguments (3 occurrences):
- plugins/wiki/parserdefault/macro.php
- plugins/content/formathtml/macro.php
- components/com_courses/models/assets/handler.php
Used static::class for late static binding in singleton
patterns, __CLASS__ for class name comparisons.
2. Removed deprecated E_STRICT constant (4 occurrences):
- libraries/Hubzero/Error/Handler.php
- bootstrap/Api/Providers/ErrorServiceProvider.php
- bootstrap/Administrator/Providers/ErrorServiceProvider.php
- bootstrap/Site/Providers/ErrorServiceProvider.php
E_STRICT has been part of E_ALL since PHP 5.4.
NULLABLE PARAMETER FIXES (deprecated in PHP 8.4):
3. Added explicit nullable syntax to 13 parameters:
libraries/Hubzero/ (7 fixes):
- Base/Application.php: ?Request, ?Response
- Log/Writer.php: ?DispatcherInterface
- Error/Exception/NotFoundException.php: ?\Exception
- Error/Exception/NotAuthorizedException.php: ?\Exception
- Error/Exception/MethodNotAllowedException.php: ?\Exception
- Encryption/Encrypter.php: ?Cipher, ?Key
- Events/Debug/TraceableDispatcher.php: ?Logger
plugins/ (3 fixes):
- support/slack/lib/Client.php: ?Guzzle
- user/constantcontact/lib/CTCTException.php: ?\Exception
- user/constantcontact/lib/ConstantContact.php
components/ (2 fixes):
- com_wiki/helpers/Diff/DiffFormatter.php: ?Closure
- com_cron/helpers/Cron/CronExpression.php: ?FieldFactory
Changed "Type $param = null" to "?Type $param = null".
BACKWARD COMPATIBILITY:
- All fixes are backward compatible with PHP 7.1+
- Works perfectly with PHP 8.0, 8.1, 8.2, 8.3
- Fully compatible with PHP 8.4 (zero deprecation warnings)
Files modified: 19
Total fixes: 17 (3 get_class, 4 E_STRICT, 13 nullable)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 9c64330 commit 12cd00a
31 files changed
Lines changed: 59 additions & 47 deletions
File tree
- core
- bootstrap
- Administrator/Providers
- Api/Providers
- Site/Providers
- components
- com_collections/models
- com_courses/models
- assets
- com_cron/helpers/Cron
- com_publications
- helpers
- models
- com_tools/helpers
- com_wiki/helpers/Diff
- libraries/Hubzero
- Base
- Database
- Encryption
- Error
- Exception
- Events
- Debug
- Log
- plugins
- content/formathtml
- courses/announcements
- resources/about/views/index/tmpl
- support/slack/lib
- user/constantcontact/lib
- Components
- wiki/parserdefault
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | | - | |
391 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
392 | 394 | | |
393 | 395 | | |
394 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1409 | 1409 | | |
1410 | 1410 | | |
1411 | 1411 | | |
1412 | | - | |
1413 | 1412 | | |
1414 | 1413 | | |
1415 | 1414 | | |
| |||
1462 | 1461 | | |
1463 | 1462 | | |
1464 | 1463 | | |
1465 | | - | |
1466 | 1464 | | |
1467 | 1465 | | |
1468 | 1466 | | |
| |||
0 commit comments