Add return, property, and parameter type hints to code

Created on 6 September 2023, about 1 year ago
Updated 16 September 2023, about 1 year ago

Problem/Motivation

With 2.x now targeting PHP ^8.1 we can leverage a number of improvements in PHP regarding code type.

Implementing type hints more broadly through the code will allow for better code parsing by tools including PHPStan reduce the risk of unseen errors in tfa and other ecosystem modules.

Steps to reproduce

Review Code

Proposed resolution

Add type hints to properties, parameters, and method/function returns

Remaining tasks

Patch

User interface changes

None

API changes

All code will now be type hinted, including interfaces, this will require those who implement our interfaces to also type hint their code.

Some code may have type-hint adjusted to be more accurate if the PHPDocs are not fully accurate, the majority of the code however is expected to match its existing documentation.

Data model changes

None expected.

Assigning this to myself as I'm also using this as a good reason to review the code and get better acquainted with its internals.

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cmlara

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024