Problem/Motivation

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

Steps to reproduce

 

Proposed resolution

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.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

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

dydave created an issue. See original summary.

  • dydave committed 46c14bb9 on 3.x
    Issue #3565094 by dydave: Added 'declare(strict_types=1)' to all PHP...
dydave’s picture

Status: Active » Fixed

Quick 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!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.