Closed (fixed)
Project:
Admin Toolbar
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Dec 2025 at 23:32 UTC
Updated:
13 Jan 2026 at 00:24 UTC
Jump to comment: Most recent
Currently very few PHP files in the project's repository implement type hinting by adding declare(strict_types=1);.
See useful resources:
See an example of a similar issue: #3442610: Declare strict types
From what I could understand, we would want strict types hinting to be implemented in as many PHP files as possible.
I don't really see anything that could prevent from adding strict types declarations to all PHP files in the project.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
dydave commentedQuick follow-up on this task:
Added:
declare(strict_types=1);to all PHP files except for'.install'or'.post_update.php'.Overall, I don't think I missed any file, but if I did, we can still add the strict types declarations as we make more changes to PHP files in the future.
Since all the jobs and tests seemed to still be passing 🟢, I went ahead and merged the changes above at #3. 🥳
Marking issue as Fixed, for now.
Feel free to let us know if you have any questions or concerns on any of the latest code changes or this project in general, we would surely be glad to help.
Thanks in advance!