'Upgrading from PHP 5 to PHP 7.4

I'm upgrading an exsiting application from PHP 5.3 to PHP 7.4

    class Cl_Detail_Familles_Produit extends Cl_Form
    {
      public $ref_annuler = "../coh/list_produit.inc";
    .
    .
    .

PHPStorm display this error about ref_annuler Type must be 'mixed|string' (as in base class '\Cl_Form')

class Cl_Form
{
.
.
.
  function print_annuler()
  {
    $this->ref_annuler = $_GET["ret"] ?: base64_encode($this->ref_annuler);
.
.
.

I didn't find the declation of the attribute ref_annuler inside the class Cl_Form it is used once in this class



Solution 1:[1]

PHPSorm, depening on the PHP version, will give you little hints here and there. That shouldn't prevent you code from working.
However, if you want to get rid of it, add a small dockblock, which should solve the issue.

/**
 * @var mixed|string $ref_annuler 
 */
public $ref_annuler = "../coh/list_produit.inc";

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guido Faecke