Page MenuHomePhabricator

css-sanitizer PHP 7.4 failure due to SeekableIterator::seek() signature change
Closed, ResolvedPublic

Description

03:07:57 src/Objects/CSSObjectList.php:124 PhanParamSignatureRealMismatchHasNoParamTypeInternal Declaration of function seek($offset) should be compatible with internal function seek(int $position) (parameter #1 with no type cannot replace original parameter with type 'int')

Seen on https://gerrit.wikimedia.org/r/#/c/css-sanitizer/+/592162/ and https://integration.wikimedia.org/ci/job/composer-package-php74-docker/603/console

Presuambly if we add the type hint we break it for 7.2/7.3?

Event Timeline

Reedy updated the task description. (Show Details)

Change 592182 had a related patch set uploaded (by Reedy; owner: Reedy):
[css-sanitizer@master] Add int type hint to seek function

https://gerrit.wikimedia.org/r/592182

Presuambly if we add the type hint we break it for 7.2/7.3?

Yup!

03:29:09 PHP Fatal error:  Declaration of Wikimedia\CSS\Objects\CSSObjectList::seek(int $offset) must be compatible with SeekableIterator::seek($position) in /src/src/Objects/CSSObjectList.php on line 14

Change 592465 had a related patch set uploaded (by Reedy; owner: Reedy):
[css-sanitizer@master] Suppress PhanParamSignatureRealMismatchHasNoParamTypeInternal in seek()

https://gerrit.wikimedia.org/r/592465

Reedy renamed this task from css-sanitizer PHP 7.4 failure to css-sanitizer PHP 7.4 failure due to SeekableIterator::seek() signature change.Apr 25 2020, 7:53 PM

Change 592465 merged by jenkins-bot:
[css-sanitizer@master] Set phan allow_method_param_type_widening = true

https://gerrit.wikimedia.org/r/592465

Reedy claimed this task.
  NODES
INTERN 3
Note 1
Project 3