never cannot be used as a parameter type

Description

Never is a PHP return type, that is used to indicate that a method will not return a value. As such, it makes no sense to use with a parameter, as a parameter cannot return any value. Hence, the never type cannot be used with a parameter.

Example

<?php

function foo(never $n) {}

?>

Solutions

  • Remove the never type.

  • Change the never type to another type.