Upgrading from PHP 5 to PHP 7.4

130 Views Asked by At

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

1

There are 1 best solutions below

1
Guido Faecke On

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";