Address deprecations for PHP 8.4 #5078

Closed
opened 2026-02-05 09:38:31 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @ssddanbrown on GitHub (Dec 11, 2024).

Originally assigned to: @ssddanbrown on GitHub.

We're in a bit of a tricky spot in regards to PHP 8.4.
While things generally work, there are many deprecations to handle, which may show to users either on the CLI (including composer install).

There's many of these in Laravel though, and Laravel 10 is not getting any specific PHP8.4 support, so we're in an akward place right now.
We'll probably update to Laravel 11 more swift than our usual stance, so quite early in the new year, which will be dropping PHP 8.1 support, so need to get ready for that.

Some work external of that to be done also though in our own codebase and some libraries.

# Running tests via php84 with deprecations
# Has "error_reporting = E_ALL & ~E_NOTICE" set in ini
php84 ./vendor/bin/phpunit --display-deprecations 2> deps.txt

BookStack

Access
  • BookStack\Access\Ldap::bind(): Implicitly marking parameter $bindPassword as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 102
  • BookStack\Access\Ldap::bind(): Implicitly marking parameter $bindRdn as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 102
  • BookStack\Access\Ldap::read(): Implicitly marking parameter $attributes as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 69
  • BookStack\Access\Ldap::searchAndGetEntries(): Implicitly marking parameter $attributes as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 90
  • BookStack\Access\Ldap::search(): Implicitly marking parameter $attributes as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 57
  • BookStack\Access\SocialDriverManager::addSocialDriver(): Implicitly marking parameter $configureForRedirect as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/SocialDriverManager.php on line 91
Entities
  • BookStack\Entities\Controllers\BookController::create(): Implicitly marking parameter $shelfSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/BookController.php on line 73
  • BookStack\Entities\Controllers\BookController::store(): Implicitly marking parameter $shelfSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/BookController.php on line 96
  • BookStack\Entities\Controllers\PageController::createAsGuest(): Implicitly marking parameter $chapterSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/PageController.php on line 72
  • BookStack\Entities\Controllers\PageController::create(): Implicitly marking parameter $chapterSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/PageController.php on line 44
  • BookStack\Entities\Queries\QueryPopular::run(): Implicitly marking parameter $filterModels as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Queries/QueryPopular.php on line 21
  • BookStack\Entities\Repos\RevisionRepo::storeNewForPage(): Implicitly marking parameter $summary as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Repos/RevisionRepo.php on line 49
Theming
  • BookStack\Theming\ThemeService::addSocialDriver(): Implicitly marking parameter $configureForRedirect as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Theming/ThemeService.php on line 87
Uploads
  • BookStack\Uploads\ImageRepo::destroyImage(): Implicitly marking parameter $image as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 187
  • BookStack\Uploads\ImageRepo::getPaginatedByType(): Implicitly marking parameter $search as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 48
  • BookStack\Uploads\ImageRepo::getPaginatedByType(): Implicitly marking parameter $uploadedTo as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 48
  • BookStack\Uploads\ImageRepo::getPaginatedByType(): Implicitly marking parameter $whereClause as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 48
  • BookStack\Uploads\ImageRepo::saveNew(): Implicitly marking parameter $resizeHeight as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 112
  • BookStack\Uploads\ImageRepo::saveNew(): Implicitly marking parameter $resizeWidth as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 112
  • BookStack\Uploads\ImageService::saveNewFromUpload(): Implicitly marking parameter $resizeHeight as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageService.php on line 30
  • BookStack\Uploads\ImageService::saveNewFromUpload(): Implicitly marking parameter $resizeWidth as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageService.php on line 30
Users
  • BookStack\Users\Controllers\UserApiController::rules(): Implicitly marking parameter $userId as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Users/Controllers/UserApiController.php on line 36
Utils
  • BookStack\Util\SsrUrlValidator::__construct(): Implicitly marking parameter $config as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Util/SsrUrlValidator.php on line 11

Libraries/Dependacies

It's likely many of these are already addressed, but we're just stuck or using old versions, and therefore could be solved when it comes to upgrading laravel anyway.

Carbon

Solved via Laravel upgrade.

Dompdf

Addressed by lib upgrade

Snappy

Addressed by lib upgrade

League/Oauth2

Addressed by lib upgrade

OneLogin/Saml2

Addressed on 4.x brach: https://github.com/SAML-Toolkits/php-saml/tree/4.x-dev, waiting for release.

  • OneLogin\Saml2\Auth::__construct(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/onelogin/php-saml/src/Saml2/Auth.php on line 174
  • OneLogin\Saml2\Settings::__construct(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/onelogin/php-saml/src/Saml2/Settings.php on line 123
  • OneLogin\Saml2\Utils::query(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/onelogin/php-saml/src/Saml2/Utils.php on line 955
SocialiteProviders

Addressed by lib upgrade

Ssddanbrown
  • Ssddanbrown\AssertHtml\Constraints\PageConstraint::fail(): Implicitly marking parameter $comparisonFailure as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/asserthtml/src/Constraints/PageConstraint.php on line 54
  • Ssddanbrown\AssertHtml\HtmlTest::assertLinkExists(): Implicitly marking parameter $text as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/asserthtml/src/HtmlTest.php on line 73
  • Ssddanbrown\AssertHtml\HtmlTest::assertLinkNotExists(): Implicitly marking parameter $text as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/asserthtml/src/HtmlTest.php on line 81
  • Ssddanbrown\HtmlDiff\WordSplitter::findBlocks(): Implicitly marking parameter $blockExpressions as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/htmldiff/src/WordSplitter.php on line 205
Originally created by @ssddanbrown on GitHub (Dec 11, 2024). Originally assigned to: @ssddanbrown on GitHub. We're in a bit of a tricky spot in regards to PHP 8.4. While things generally work, there are many deprecations to handle, which may show to users either on the CLI (including composer install). There's many of these in Laravel though, and Laravel 10 is not getting any specific PHP8.4 support, so we're in an akward place right now. We'll probably update to Laravel 11 more swift than our usual stance, so quite early in the new year, which will be dropping PHP 8.1 support, so need to get ready for that. Some work external of that to be done also though in our own codebase and some libraries. ```bash # Running tests via php84 with deprecations # Has "error_reporting = E_ALL & ~E_NOTICE" set in ini php84 ./vendor/bin/phpunit --display-deprecations 2> deps.txt ``` ### BookStack <details><summary>Access</summary> - [x] BookStack\Access\Ldap::bind(): Implicitly marking parameter $bindPassword as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 102 - [x] BookStack\Access\Ldap::bind(): Implicitly marking parameter $bindRdn as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 102 - [x] BookStack\Access\Ldap::read(): Implicitly marking parameter $attributes as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 69 - [x] BookStack\Access\Ldap::searchAndGetEntries(): Implicitly marking parameter $attributes as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 90 - [x] BookStack\Access\Ldap::search(): Implicitly marking parameter $attributes as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/Ldap.php on line 57 - [x] BookStack\Access\SocialDriverManager::addSocialDriver(): Implicitly marking parameter $configureForRedirect as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Access/SocialDriverManager.php on line 91 </details> <details><summary>Entities</summary> - [x] BookStack\Entities\Controllers\BookController::create(): Implicitly marking parameter $shelfSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/BookController.php on line 73 - [x] BookStack\Entities\Controllers\BookController::store(): Implicitly marking parameter $shelfSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/BookController.php on line 96 - [x] BookStack\Entities\Controllers\PageController::createAsGuest(): Implicitly marking parameter $chapterSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/PageController.php on line 72 - [x] BookStack\Entities\Controllers\PageController::create(): Implicitly marking parameter $chapterSlug as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Controllers/PageController.php on line 44 - [x] BookStack\Entities\Queries\QueryPopular::run(): Implicitly marking parameter $filterModels as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Queries/QueryPopular.php on line 21 - [x] BookStack\Entities\Repos\RevisionRepo::storeNewForPage(): Implicitly marking parameter $summary as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Entities/Repos/RevisionRepo.php on line 49 </details> <details><summary>Theming</summary> - [x] BookStack\Theming\ThemeService::addSocialDriver(): Implicitly marking parameter $configureForRedirect as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Theming/ThemeService.php on line 87 </details> <details><summary>Uploads</summary> - [x] BookStack\Uploads\ImageRepo::destroyImage(): Implicitly marking parameter $image as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 187 - [x] BookStack\Uploads\ImageRepo::getPaginatedByType(): Implicitly marking parameter $search as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 48 - [x] BookStack\Uploads\ImageRepo::getPaginatedByType(): Implicitly marking parameter $uploadedTo as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 48 - [x] BookStack\Uploads\ImageRepo::getPaginatedByType(): Implicitly marking parameter $whereClause as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 48 - [x] BookStack\Uploads\ImageRepo::saveNew(): Implicitly marking parameter $resizeHeight as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 112 - [x] BookStack\Uploads\ImageRepo::saveNew(): Implicitly marking parameter $resizeWidth as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageRepo.php on line 112 - [x] BookStack\Uploads\ImageService::saveNewFromUpload(): Implicitly marking parameter $resizeHeight as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageService.php on line 30 - [x] BookStack\Uploads\ImageService::saveNewFromUpload(): Implicitly marking parameter $resizeWidth as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Uploads/ImageService.php on line 30 </details> <details><summary>Users</summary> - [x] BookStack\Users\Controllers\UserApiController::rules(): Implicitly marking parameter $userId as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Users/Controllers/UserApiController.php on line 36 </details> <details><summary>Utils</summary> - [x] BookStack\Util\SsrUrlValidator::__construct(): Implicitly marking parameter $config as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/app/Util/SsrUrlValidator.php on line 11 </details> ### Libraries/Dependacies It's likely many of these are already addressed, but we're just stuck or using old versions, and therefore could be solved when it comes to upgrading laravel anyway. <details><summary>Carbon</summary> Solved via Laravel upgrade. </details> <details><summary>Dompdf</summary> Addressed by lib upgrade </details> <details><summary>Snappy</summary> Addressed by lib upgrade </details> <details><summary>League/Oauth2</summary> Addressed by lib upgrade </details> <details><summary>OneLogin/Saml2</summary> Addressed on 4.x brach: https://github.com/SAML-Toolkits/php-saml/tree/4.x-dev, waiting for release. - [ ] OneLogin\Saml2\Auth::__construct(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/onelogin/php-saml/src/Saml2/Auth.php on line 174 - [ ] OneLogin\Saml2\Settings::__construct(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/onelogin/php-saml/src/Saml2/Settings.php on line 123 - [ ] OneLogin\Saml2\Utils::query(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/onelogin/php-saml/src/Saml2/Utils.php on line 955 </details> <details><summary>SocialiteProviders</summary> Addressed by lib upgrade </details> <details><summary>Ssddanbrown</summary> - [x] Ssddanbrown\AssertHtml\Constraints\PageConstraint::fail(): Implicitly marking parameter $comparisonFailure as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/asserthtml/src/Constraints/PageConstraint.php on line 54 - [x] Ssddanbrown\AssertHtml\HtmlTest::assertLinkExists(): Implicitly marking parameter $text as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/asserthtml/src/HtmlTest.php on line 73 - [x] Ssddanbrown\AssertHtml\HtmlTest::assertLinkNotExists(): Implicitly marking parameter $text as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/asserthtml/src/HtmlTest.php on line 81 - [x] Ssddanbrown\HtmlDiff\WordSplitter::findBlocks(): Implicitly marking parameter $blockExpressions as nullable is deprecated, the explicit nullable type must be used instead in /home/dan/web/bookstack/vendor/ssddanbrown/htmldiff/src/WordSplitter.php on line 205 </details>
OVERLORD added the 🔧 Maintenance🏭 Back-End labels 2026-02-05 09:38:31 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 17, 2025):

PR with changes in #5491.

Just a couple of libs to go now, both raised/in-progress:

@ssddanbrown commented on GitHub (Feb 17, 2025): PR with changes in #5491. Just a couple of libs to go now, both raised/in-progress: - SocialiteProviders\Okta: https://github.com/SocialiteProviders/Providers/issues/1335 - SAML-Toolkits\php-saml: https://github.com/SAML-Toolkits/php-saml/issues/605#issuecomment-2597846711
Author
Owner

@ssddanbrown commented on GitHub (May 27, 2025):

Looks to be all sorted now as of 7650ebf2f9.

@ssddanbrown commented on GitHub (May 27, 2025): Looks to be all sorted now as of 7650ebf2f90d120d2ae3c3b12560cf7449c6978b.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5078