-
-
Notifications
You must be signed in to change notification settings - Fork 82
Update for PHP 8.4 as minimum #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- phpunit.xml.dist: Migrate from deprecated <filter>/<whitelist> to PHPUnit 11 <source>/<include> format, remove deprecated <logging>, add cacheDirectory and deprecation display settings - CI workflows: Update to PHP 8.4 only (remove 7.2-8.3 matrix) - CI configs: Update PHP versions in sonar-project.properties, qodana.yaml, .scrutinizer.yml - composer.json.dist: Add path repository for local base-requires, change version constraint to dev-master - bootstrap.php + init_new.php: Update PHP version checks to 8.4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Major test suite cleanup resolving all errors, failures, warnings, and deprecations (250+ files modified): - Add DatabaseTestTrait + phpunit_bootstrap.php for graceful DB skip guards across 30+ test files - Replace 75 getMockForAbstractClass() calls with createMock() or getMockBuilder()->onlyMethods() for PHPUnit 11 - Add `: void` return types to setUp()/tearDown() methods (400+ files) - Replace assertRegExp() with assertMatchesRegularExpression() (21 calls) - Fix test file renames for PHPUnit 11 class-not-found warnings - Convert @dataProvider/@group annotations to PHP 8 attributes - Add ICU version-aware guards for locale tests - Add RegDom class existence checks for missing geekwright/regdom - Add ThemeSet class loading for XML theme parser test files - Replace array_key_exists on objects with offsetExists() - Replace PHPUnit\Framework\Error\Warning with @ suppression Result: Tests: 3156, Assertions: 6107, Errors: 0, Failures: 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add explicit `?` prefix for 84+ implicit nullable parameter types
across 55+ files (Connection, CriteriaElement, QueryBuilder,
XoopsUser, StorageInterface, etc.)
- Remove get_magic_quotes_gpc() calls (removed in PHP 8.0) in
MediaUploader, protector, gtickets
- Remove E_STRICT references (deprecated in PHP 8.4) from Logger
- Replace utf8_encode() (deprecated in PHP 8.2) with
mb_convert_encoding() in 5 files
- Fix deprecated ${var} string interpolation to {$var} in 2 files
- Convert PHPUnit @dataProvider/@group annotations to PHP 8 attributes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adapt XOOPS code to work with the modernized dependency stack:
- Assets.php: Migrate from geekwright/assetic-fork to assetic/framework
^3.1. Create MinifyCssFilter and MinifyJsFilter wrapping
matthiasmullie/minify (replaces patchwork/jsqueeze + natxet/cssmin)
- Logger.php + MonologLogger + DebugbarLogger + LegacyLogger: Add
string|\Stringable param types and : void return types for PSR-3 v3
- 11 console Commands: Add : int return types + Command::SUCCESS/FAILURE
returns for Symfony Console 7.x
- MonologLogger: Update xoopsDataProcessor() for Monolog 3.x LogRecord
objects (immutable records, with() method)
- Debug.php: Match dump(...$args): int|string signature for Kint 6.x
- common.php: Remove Patchwork\Utf8\Bootup calls, replace with
mb_internal_encoding('UTF-8')
- AbstractLocale.php: Replace Patchwork\Utf8 with mb_trim() (PHP 8.4),
Normalizer::normalize(), Collator::asort()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Doctrine DBAL 4.x breaking changes addressed: - Connection.php: Add backward-compat insert()/update()/delete() overrides that backtick-quote all column names. DBAL 4 does not quote identifiers in DML methods, causing SQLSTATE[42000] syntax errors with MySQL 8.0+ reserved words (rank, level in system_user) - QueryBuilder.php: Add backward-compat execute() shim (routes SELECT to executeQuery(), DML to executeStatement()) and resetQueryParts() using reflection to reset private parent properties - Factory.php: Adapt for DBAL 4 protected connect(), removed query() - New Logging middleware: XoopsLoggingMiddleware, XoopsQueryLogger, XoopsLoggingConnection/Driver/Statement for DBAL 4 (replaces removed getSQLLogger()) - New Schema files: SchemaSynchronizer, SchemaVisitorInterface for DBAL 4 compatibility Installer fixes: - install_acceptUser(): Add null guard after array_pop() (getVar on null) - page_configsite.php: Add null config guard in POST handler - setcookie(): Fix PHP 8.4 null deprecation in 3 installer files - round(): Add (float) cast for PHP 8.4 strict typing in 4 files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- enable(): Add class_exists('DebugBar\StandardDebugBar') guard before
instantiation — gracefully degrade when package not installed
- enable(): Move $this->activated = true after successful debugbar init
to prevent log() from accessing uninitialized $this->debugbar
- log(): Add is_object($this->debugbar) guard and hasCollector()
fallback for missing channel collectors
- addToTheme(): Update getAssets() call for v3.3 associative return
format ($allAssets['css']/$allAssets['js'] instead of list())
- Remove setEnableJqueryNoConflict() call (removed in v3.3, jQuery
no longer bundled)
- XoopsTheme.php: Replace @$attrs['_'] with !empty($attrs['_']) to
fix PHP 8.4 undefined array key warnings in renderMetasByType()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 300 files, which is 150 over the limit of 150. You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the codebase and tooling to require PHP 8.4+, aligning tests and runtime code with newer PHPUnit and Doctrine DBAL APIs.
Changes:
- Raise the minimum PHP version to 8.4 across CI, tooling configs, and test bootstrap.
- Modernize tests for PHPUnit 10/11 (lifecycle signatures, regex assertions, attributes-based data providers).
- Update database-related code for Doctrine DBAL 4 (FetchMode removal, result fetch APIs, schema synchronizer changes).
Reviewed changes
Copilot reviewed 284 out of 517 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/XoopsPrivateMessageHandlerTest.php | PHPUnit 9+ regex assertion + DB-required skip |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/XoopsBlockTest.php | Add DB-required skip for DB-dependent test |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/UserTest.php | Add DB-required skip in setUp |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/UserHandlerTest.php | PHPUnit regex assertion update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/TplSetHandlerTest.php | PHPUnit regex assertion + DB-required skip |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/OnlineTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/OnlineHandlerTest.php | PHPUnit regex assertion + DB-required skip |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/ModuleTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/ModuleHandlerTest.php | PHPUnit regex assertion + DB-required skip |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/MembershipTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/MembershipHandlerTest.php | PHPUnit regex assertion + DB-required skip |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/MemberHandlerTest.php | Add DB-required skip in setUp |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/GrouppermTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/GrouppermHandlerTest.php | PHPUnit regex assertion + DB-required skip |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/GroupTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/GroupHandlerTest.php | PHPUnit regex assertion update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/ConfigOptionTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/ConfigOptionHandlerTest.php | PHPUnit regex assertion update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/ConfigItemTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/ConfigItemHandlerTest.php | PHPUnit regex assertion update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/ConfigHandlerTest.php | Add DB-required skip in setUp |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/BlockModuleLinkTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/BlockModuleLinkHandlerTest.php | PHPUnit regex assertion update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Handlers/BlockHandlerTest.php | PHPUnit regex assertion + DB-required skip |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeUrlTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeTimeZoneTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeTextBoxTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeTextAreaTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeSourceTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeSimpleTimeTest.php | DataProvider attribute + static provider |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeOtherTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeMoneyTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeJsonTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeIntTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeFloatTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeEnumerationTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeEmailTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeDecimalTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeDateTimeTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeArrayTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Kernel/Dtype/DtypeAbstractTest.php | Replace deprecated attribute reads via reflection |
| tests/unit/xoopsLib/Xoops/Core/Kernel/CriteriaElementTest.php | Nullable type syntax modernization |
| tests/unit/xoopsLib/Xoops/Core/HttpRequestTest.php | PHPUnit lifecycle update + optional dependency skips |
| tests/unit/xoopsLib/Xoops/Core/Handler/Scheme/SchemeInterfaceTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Handler/Scheme/LegacyModuleTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Handler/Scheme/KernelTest.php | DataProvider attribute + lifecycle update |
| tests/unit/xoopsLib/Xoops/Core/Handler/Scheme/FQNTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Handler/FactoryTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Handler/FactorySpecTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/FixedGroupsTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/FilterInputTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Exception/NotSupportedExceptionTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Exception/NoHandlerExceptionTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Exception/InvalidHandlerSpecExceptionTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/EventsTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Database/Schema/RemovePrefixesTest.php | DBAL 4 Types + visitor interface update |
| tests/unit/xoopsLib/Xoops/Core/Database/Schema/ImportSchemaTest.php | DBAL 4 Types constant update |
| tests/unit/xoopsLib/Xoops/Core/Database/Schema/ExportVisitorTest.php | DBAL 4 Types + visitor interface update |
| tests/unit/xoopsLib/Xoops/Core/Database/QueryBuilderTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Core/Database/Logging/XoopsDebugStackTest.php | Update test target to new query logger |
| tests/unit/xoopsLib/Xoops/Core/Database/FactoryTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Database/ConnectionTest.php | DBAL 4 driver + constructor signature update |
| tests/unit/xoopsLib/Xoops/Core/Cache/LegacyTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Cache/DriverListTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Cache/CacheManagerTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/Cache/AccessTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/Core/AssetsTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xoops/CacheTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Auth/XoopsTest.php | Add DB-required skip in setUp |
| tests/unit/xoopsLib/Xoops/Auth/ProvisioningTest.php | Add DB-required skip in setUp |
| tests/unit/xoopsLib/Xoops/Auth/LdapTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xoops/Auth/FactoryTest.php | Ensure ldap bypass config set for tests |
| tests/unit/xoopsLib/Xoops/Auth/AdsTest.php | PHPUnit setUp signature update |
| tests/unit/xoopsLib/Xmf/YamlTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/UuidTest.php | Regex assertion modernization |
| tests/unit/xoopsLib/Xmf/StopWordsTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/RequestTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/RandomTest.php | Regex assertion modernization |
| tests/unit/xoopsLib/Xmf/Module/HelperTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Module/Helper/SessionTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Module/Helper/PermissionTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Module/Helper/GenericHelperTest.php | Skip when module not DB-loadable |
| tests/unit/xoopsLib/Xmf/Module/Helper/CacheTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Module/Helper/AbstractHelperTest.php | Replace deprecated attribute assertions via reflection |
| tests/unit/xoopsLib/Xmf/Module/AdminTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/MetagenTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/LanguageTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Key/StorageInterfaceTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Key/KeyAbstractTest.php | Update abstract mocking for newer PHPUnit |
| tests/unit/xoopsLib/Xmf/Key/FileStorageTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Key/BasicTest.php | Regex assertion modernization |
| tests/unit/xoopsLib/Xmf/Key/ArrayStorageTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Jwt/TokenReaderTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Jwt/TokenFactoryTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Jwt/KeyFactoryTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Jwt/JsonWebTokenTest.php | Replace removed PHPUnit object-attribute assertions |
| tests/unit/xoopsLib/Xmf/IPAddressTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/HighlighterTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/FilterInputTest.php | DataProvider attribute + static provider |
| tests/unit/xoopsLib/Xmf/DebugTest.php | PHPUnit lifecycle signature update |
| tests/unit/xoopsLib/Xmf/Database/TablesTest.php | Add DB-required skip in setUp |
| tests/unit/xoopsLib/Xmf/Database/TableLoadTest.php | Add DB-required skip in setUp |
| tests/unit/xoopsLib/Xmf/Database/MigrateTest.php | Skip test when module/DB prerequisite missing |
| tests/unit/xoopsLib/Xmf/AssertTest.php | DataProvider attributes + static providers |
| tests/unit/phpunit_bootstrap.php | Central PHPUnit bootstrap for traits/autoload |
| tests/unit/kernel/userTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/userHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/tplsetTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/tplsetHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/tplfileTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/tplfileHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/privmessageTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/privmessageHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/onlineTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/onlineHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/moduleTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/moduleHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/membershipTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/membershipHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/memberTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/grouppermTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/grouppermHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/groupTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/groupHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/configoptionTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/configoptionHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/configitemTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/configitemHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/configHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/blockmodulelinkTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/blockmodulelinkHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/blockTest.php | PHPUnit setUp signature update |
| tests/unit/kernel/blockHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/init_new.php | Enforce PHP 8.4+ for unit tests |
| tests/unit/class/xoopsmailerTest.php | Add DB-required skip in setUp |
| tests/unit/class/xoopsloadTest.php | PHPUnit setUp signature update |
| tests/unit/class/xoopslistsTest.php | Regex assertion modernization |
| tests/unit/class/xoopsform/formselectuserTest.php | Add DB-required skip in setUp |
| tests/unit/class/xoopsform/formselectgroupTest.php | Add DB-required skip in setUp |
| tests/unit/class/xoopsform/formselectcheckgroupTest.php | Add DB-required skip in setUp |
| tests/unit/class/xml/themesetparserTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/xoopsapiTest.php | Add DB-required skip in setUp |
| tests/unit/class/xml/rpc/xmlrpcparserTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/xmlrpcapiTest.php | Add DB-required skip in setUp |
| tests/unit/class/xml/rpc/bloggerapiTest.php | Add DB-required skip in setUp |
| tests/unit/class/xml/rpc/XoopsXmlRpcResponseTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/XoopsXmlRpcRequestTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/XoopsXmlRpcDocumentTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcValueHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcStructHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcStringHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcNameHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcMethodNameHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcMemberHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcIntHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcDoubleHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcDateTimeHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcBooleanHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcBase64HandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/rpc/RpcArrayHandlerTest.php | PHPUnit setUp signature update |
| tests/unit/class/xml/ThemeSetTemplateHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetTagHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetNameHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetModuleHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetLinkHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetImageHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetGeneratorHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetFileTypeHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetEmailHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetDescriptionHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetDateCreatedHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/xml/ThemeSetAuthorHandlerTest.php | Ensure parser class loaded + setUp signature |
| tests/unit/class/utility/xoopsutilityTest.php | PHPUnit setUp signature update |
| tests/unit/class/uploaderTest.php | PHPUnit setUp signature update |
| tests/unit/class/treeTest.php | PHPUnit setUp signature update |
| tests/unit/class/themeTest.php | PHPUnit setUp signature update |
| tests/unit/class/themeFactoryTest.php | Add DB-required skip in setUp |
| tests/unit/class/themeFactoryAdminTest.php | PHPUnit setUp signature update |
| tests/unit/class/templateTest.php | PHPUnit lifecycle signature update |
| tests/unit/class/pagenavTest.php | PHPUnit setUp signature update |
| tests/unit/class/file/XoopsFolderHandlerTest.php | PHPUnit lifecycle signature update |
| tests/unit/class/downloaderTest.php | Update abstract mocking for newer PHPUnit |
| tests/unit/class/database/sqlutilityTest.php | PHPUnit setUp signature update |
| tests/unit/class/database/mysqldatabasesafeTest.php | PHPUnit setUp signature update |
| tests/unit/class/database/mysqldatabaseproxyTest.php | PHPUnit setUp signature update |
| tests/unit/class/database/managerTest.php | PHPUnit setUp signature update |
| tests/unit/class/database/databasefactoryTest.php | PHPUnit setUp signature update |
| tests/unit/class/criteriaElementTest.php | Nullable type syntax modernization |
| tests/unit/class/captcha/xoopscaptchaTest.php | PHPUnit lifecycle signature update |
| tests/unit/class/captcha/recaptchaTest.php | Improve skips and setup to avoid crashes |
| tests/unit/class/captcha/image/scripts/imageclassTest.php | Skip when GD missing; ensure image created |
| tests/unit/class/ThemeBlocksTest.php | PHPUnit setUp signature update |
| tests/unit/class/ModuleMyTextSanitizerTest.php | Replace deprecated PHPUnit annotations/APIs |
| tests/unit/bootstrap.php | Enforce PHP 8.4+ and load DB trait |
| tests/unit/DatabaseTestTrait.php | Add reusable DB-availability skip helper |
| sonar-project.properties | Update PHP version for analysis tooling |
| qodana.yaml | Update PHP version and composer platform |
| phpunit.xml.dist | Switch bootstrap and PHPUnit 10+ config keys |
| htdocs/modules/xlanguage/class/xlanguage.php | Nullable parameter type modernization |
| htdocs/modules/xlanguage/class/form/language.php | Nullable parameter type modernization |
| htdocs/modules/userrank/class/UserRankProvider.php | DBAL 4 fetch + parameter naming updates |
| htdocs/modules/userconfigs/class/option.php | Nullable parameter type modernization |
| htdocs/modules/userconfigs/class/item.php | Nullable parameter type modernization |
| htdocs/modules/userconfigs/class/config.php | Nullable parameter type modernization |
| htdocs/modules/system/include/update.php | DBAL 4 fetchNumeric update |
| htdocs/modules/system/class/module.php | DBAL schema synchronizer + version casts |
| htdocs/modules/system/class/extension.php | Version casts for consistent comparison |
| htdocs/modules/system/blocks/info.php | DBAL 4 fetch + parameter naming updates |
| htdocs/modules/system/admin/users/users.php | DBAL 4 fetchAllAssociative update |
| htdocs/modules/system/admin/users/jquery.php | DBAL parameter naming updates |
| htdocs/modules/system/admin/tplsets/main.php | Replace utf8_encode for PHP 8.x |
| htdocs/modules/smilies/class/smiley.php | Nullable parameter type modernization |
| htdocs/modules/schematool/admin/schematool.php | Use schema synchronizer abstraction |
| htdocs/modules/publisher/src/Utils.php | Replace deprecated string interpolation + encoding |
| htdocs/modules/publisher/src/RatingHandler.php | Nullable parameter type modernization |
| htdocs/modules/publisher/src/PermissionHandler.php | DBAL 4 fetchAssociative update |
| htdocs/modules/publisher/src/MimetypeHandler.php | Nullable parameter type modernization |
| htdocs/modules/publisher/src/ItemHandler.php | DBAL 4 fetch + parameter naming updates |
| htdocs/modules/publisher/src/Item.php | DBAL 4 fetchAssociative update |
| htdocs/modules/publisher/admin/permissions.php | DBAL 4 fetchAllAssociative update |
| htdocs/modules/protector/class/protector.php | Remove magic quotes usage for PHP 8 |
| htdocs/modules/protector/class/gtickets.php | Remove magic quotes usage for PHP 8 |
| htdocs/modules/profile/include/forms.php | Nullable parameter type modernization |
| htdocs/modules/profile/class/visibility.php | DBAL 4 fetchNumeric update + nullables |
| htdocs/modules/profile/class/regstep.php | Nullable parameter type modernization |
| htdocs/modules/profile/class/profile.php | DBAL 4 fetchOne/fetchAssociative update |
| htdocs/modules/profile/class/field.php | Nullable parameter type modernization |
| htdocs/modules/profile/class/category.php | Nullable parameter type modernization |
| htdocs/modules/pm/class/message.php | Nullable parameter type modernization |
| htdocs/modules/plugins/class/plugin.php | DBAL 4 fetchAssociative update |
| htdocs/modules/pdf/class/HtmlToPdfProvider.php | Replace utf8_encode for PHP 8.x |
| htdocs/modules/page/class/plugin/search.php | DBAL 4 fetch + parameter naming updates |
| htdocs/modules/page/class/page_related_link.php | Nullable parameter type modernization |
| htdocs/modules/page/class/page_related.php | Nullable parameter type modernization |
| htdocs/modules/page/class/page_rating.php | Nullable parameter type modernization |
| htdocs/modules/page/class/page_content.php | Nullable parameter type modernization |
| htdocs/modules/notifications/class/notification.php | DBAL 4 fetchAssociative update + nullables |
| htdocs/modules/monolog/class/monologlogger.php | Monolog API update + stricter signatures |
| htdocs/modules/menus/class/menus.php | Nullable parameter type modernization |
| htdocs/modules/menus/class/menu.php | DBAL 4 fetchNumeric update + nullables |
| htdocs/modules/logger/class/legacylogger.php | Remove E_STRICT + stricter signatures |
| htdocs/modules/images/class/imagebody.php | Nullable parameter type modernization |
| htdocs/modules/images/class/image.php | Nullable parameter type modernization |
| htdocs/modules/images/class/category.php | Nullable parameter type modernization |
| htdocs/modules/debugbar/class/debugbarlogger.php | DBAL 4 + debugbar asset API adjustments |
| htdocs/modules/comments/class/comment.php | Nullable parameter type modernization |
| htdocs/modules/banners/class/bannerrender.php | DBAL parameter naming updates |
| htdocs/modules/banners/class/bannerclient.php | Nullable parameter type modernization |
| htdocs/modules/banners/class/banner.php | Nullable parameter type modernization |
| htdocs/modules/avatars/include/editavatar.php | DBAL parameter naming update |
| htdocs/modules/avatars/class/userlink.php | Nullable parameter type modernization |
| htdocs/modules/avatars/class/avatar.php | DBAL 4 fetch + parameter naming updates |
| htdocs/modules/avatars/admin/avatar_system.php | DBAL parameter naming update |
| htdocs/modules/avatars/admin/avatar_custom.php | DBAL parameter naming update |
| htdocs/kernel/object.php | Nullable parameter type modernization |
| htdocs/install/page_tablesfill.php | DBAL 4 fetchOne + setcookie signature update |
| htdocs/install/page_moduleinstaller.php | Version casting for numeric formatting |
| htdocs/install/page_langselect.php | setcookie signature update |
| htdocs/install/page_extensioninstaller.php | Version casting for numeric formatting |
| htdocs/install/page_end.php | setcookie signature update |
| htdocs/install/page_configsite.php | Guard against null config |
| htdocs/install/include/functions.php | DBAL 4 connect workaround + string offset update |
| htdocs/install/class/installwizard.php | String offset syntax update |
| htdocs/include/common.php | Remove abandoned UTF8 bootup; set mb encodings |
| htdocs/class/xoopseditor/tinymce4/external_plugins/filemanager/uploader/jupload.php | Replace deprecated string interpolation |
| htdocs/class/file/folder.php | String offset syntax update |
| htdocs/class/database/mysqldatabase.php | DBAL 4 result fetch API replacements |
| htdocs/class/database/manager.php | DBAL 4 connect workaround and comments |
| htdocs/class/XoopsBaseConfig.php | Remove redundant final on private methods |
| console/Commands/Utf8mb4ModuleCommand.php | Symfony command return type + DBAL Types |
| console/Commands/UpdateModuleCommand.php | Symfony command return type + exit codes |
| console/Commands/UninstallModuleCommand.php | Symfony command return type + exit codes |
| console/Commands/TestCommand.php | Symfony command return type + success code |
| console/Commands/SetConfigCommand.php | Symfony command return type + exit codes |
| console/Commands/RenameSystemTablesCommand.php | Symfony command return type + success code |
| console/Commands/InstallModuleCommand.php | Symfony command return type + exit codes |
| console/Commands/DeactivateModuleCommand.php | Symfony command return type + exit codes |
| console/Commands/CiInstallCommand.php | Symfony command return type + exit codes |
| console/Commands/CiBootstrapCommand.php | Symfony command return type + exit codes |
| console/Commands/ActivateModuleCommand.php | Symfony command return type + exit codes |
| composer.json.dist | Require PHP 8.4 + update dev dependencies |
| .scrutinizer.yml | Update PHP version for CI analysis |
| .github/workflows/sonarcloud.yml | CI uses PHP 8.4 on ubuntu-latest |
| .github/workflows/ci.yml | CI matrix updated to PHP 8.4 only |
| "repositories": [ | ||
| { | ||
| "type": "path", | ||
| "url": "../base-requires" | ||
| } | ||
| ], | ||
| "require": { | ||
| "xoops/base-requires": "^0.4.1" | ||
| "php": "^8.4", | ||
| "xoops/base-requires": "dev-master" | ||
| }, |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path repository ../base-requires is not available in typical CI/checkouts and will cause composer update to fail. Prefer a VCS/Packagist source (remove the path repo) and pin xoops/base-requires to a tagged/stable version (or a specific commit) instead of dev-master.
| $field_ids = array(); | ||
| while (list($field_id) = $result->fetch(FetchMode::NUMERIC)) { | ||
| while (list($field_id) = $result->fetchNumeric()) { | ||
| $field_ids[] = $field_ids; |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appends the $field_ids array to itself instead of appending the fetched $field_id. This will produce incorrect results (nested/self-referential arrays) and break visibility logic; change the append to use $field_id.
| $field_ids[] = $field_ids; | |
| $field_ids[] = $field_id; |
| @@ -191,7 +191,7 @@ | |||
| $query = $qb->updatePrefix('system_user') | |||
| ->set('user_avatar', 'blank.gif') | |||
| ->where($eb->eq('user_avatar', ':file ')) | |||
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder in the WHERE clause is :file (note the trailing space), but the bound parameter name is file. This mismatch will prevent binding and can cause the UPDATE to fail at runtime. Remove the trailing space in the placeholder (and keep parameter name consistent, without a leading colon).
| ->where($eb->eq('user_avatar', ':file ')) | |
| ->where($eb->eq('user_avatar', ':file')) |
| @@ -184,7 +184,7 @@ | |||
| $query = $qb->updatePrefix('system_user') | |||
| ->set('user_avatar', 'blank.gif') | |||
| ->where($eb->eq('user_avatar', ':file ')) | |||
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same parameter placeholder issue as avatar_system.php: the placeholder :file includes a trailing space and will not match the bound parameter file. Normalize it to :file (no space) and keep setParameter('file', ...).
| ->where($eb->eq('user_avatar', ':file ')) | |
| ->where($eb->eq('user_avatar', ':file')) |
| ->setParameter(':uid', $xoops->user->getVar('uid'), ParameterType::INTEGER) | ||
| ->setParameter('uid', $xoops->user->getVar('uid'), ParameterType::INTEGER) | ||
| ->setParameter( | ||
| ':avatar', |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DBAL parameter names should be bound without the leading ':' (the ':' is only used in the SQL placeholder). Here uid is bound correctly, but :avatar is not. Bind avatar (no colon) to match DBAL 4 expectations and keep placeholders as :avatar in the query.
| ':avatar', | |
| 'avatar', |
tests/unit/DatabaseTestTrait.php
Outdated
| $db->fetchAssociative('SELECT 1'); | ||
| } catch (\Exception $e) { |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests can fail with TypeError/Error as well as Exception (e.g., DBAL API mismatches). Catch \\Throwable instead of \\Exception. Also, fetchOne('SELECT 1') (or executing a query directly) is a simpler connectivity check than fetchAssociative('SELECT 1').
| $db->fetchAssociative('SELECT 1'); | |
| } catch (\Exception $e) { | |
| $db->fetchOne('SELECT 1'); | |
| } catch (\Throwable $e) { |
| bootstrap="tests/unit/phpunit_bootstrap.php" | ||
| colors="true" | ||
| cacheDirectory=".phpunit.cache" | ||
| displayDetailsOnTestsThatTriggerDeprecations="true" | ||
| displayDetailsOnTestsThatTriggerWarnings="true" | ||
| failOnDeprecation="false" | ||
| failOnWarning="false"> |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <logging> section that generated coverage.clover was removed, but the CI workflow still uploads coverage.clover and Sonar settings reference it. Ensure coverage output is still produced (e.g., by re-adding clover logging in phpunit.xml.dist or passing --coverage-clover coverage.clover in the coverage job).
htdocs/include/common.php
Outdated
| mb_internal_encoding('UTF-8'); | ||
| mb_regex_encoding('UTF-8'); |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These calls will fatally error if mbstring is not enabled. If mbstring is not guaranteed in all supported environments, guard with extension_loaded('mbstring')/function_exists() or provide a safe fallback.
| mb_internal_encoding('UTF-8'); | |
| mb_regex_encoding('UTF-8'); | |
| if (extension_loaded('mbstring')) { | |
| mb_internal_encoding('UTF-8'); | |
| mb_regex_encoding('UTF-8'); | |
| } else { | |
| trigger_error( | |
| 'mbstring extension not loaded, unable to set multibyte encodings in ' . basename(__FILE__), | |
| E_USER_WARNING | |
| ); | |
| } |
| @@ -3,21 +3,37 @@ | |||
|
|
|||
| class XoopsDebugStackTest extends \PHPUnit\Framework\TestCase | |||
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test file/class name (XoopsDebugStackTest) no longer matches the class under test (XoopsQueryLogger) and the test method semantics were updated accordingly. Rename the test file/class to reflect the new subject (or keep testing XoopsDebugStack if it still exists) to make intent and failures clearer.
| class XoopsDebugStackTest extends \PHPUnit\Framework\TestCase | |
| class XoopsQueryLoggerTest extends \PHPUnit\Framework\TestCase |
|
|
||
| $instance->stopQuery(); | ||
|
|
||
| public function test_startAndStopQuery() |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test file/class name (XoopsDebugStackTest) no longer matches the class under test (XoopsQueryLogger) and the test method semantics were updated accordingly. Rename the test file/class to reflect the new subject (or keep testing XoopsDebugStack if it still exists) to make intent and failures clearer.
Bug fixes:
- visibility.php: Fix $field_ids[] = $field_ids (self-referencing array)
to $field_ids[] = $field_id (append fetched value)
- avatar_system.php, avatar_custom.php: Remove trailing space in :file
placeholder that prevents DBAL parameter binding
- editavatar.php: Remove leading colon from 'avatar' parameter name
to match DBAL 4 binding convention (colon only in SQL placeholder)
Robustness:
- common.php: Guard mb_internal_encoding/mb_regex_encoding calls with
extension_loaded('mbstring') check
- DatabaseTestTrait: Use fetchOne() instead of fetchAssociative() and
catch \Throwable instead of \Exception for broader error coverage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
No description provided.