Closed (fixed)
Project:
Smart Date
Version:
4.2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2025 at 15:19 UTC
Updated:
26 Nov 2025 at 15:18 UTC
Jump to comment: Most recent
PHPCS give me this error when checking php8.3 compatibility :
The interface DateTimeInterface is intended for type hints only and is not implementable.
Install module and run :
phpcs -p web/module/contrib/smart_date --standard="PHPCompatibility" --runtime-set testVersion "8.3" --extensions="php,module,inc,install,test,profile,theme"
Remove "implements DateTimeInterface" since it's defined in the Timestamp class
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 #3
arwillameComment #6
mandclu commentedThanks for identifying this, and for providing a fix. Merged in.
Comment #8
rory downes commentedHi,
I am aware that this ticket is closed as fixed and indeed the scan no longer reports this error.
However, I was scanning my whole code base and saw it appear in core and reported here:
https://www.drupal.org/project/drupal/issues/3128454#comment-13761766
I have linked to the final comment where contributors have found that this is actually an issue of phpcs as it is referring to the global /TimeTimeInterface rather than core's DateTimeInterface. They declared that it did not need to be fixed in Drupal core and thus presumeably not in this module either but instead in phpcs which needs to take into account namespace.
I am not sure myself and so thought it worth bringing it up for consideration.
Regards Rory