Skip to content

Error: Required parameter $observer follows optional parameter $description #45

@ROTGP

Description

@ROTGP

I'm following the example given here and I get the following exception:

 Required parameter $observer follows optional parameter $description

  at vendor/voryx/pgasync/src/PgAsync/Command/Sync.php:13
      9▕     use CommandTrait;
     10▕ 
     11▕     private $description;
     12▕ 
  ➜  13▕     public function __construct(string $description = "", ObserverInterface $observer)
     14▕     {
     15▕         $this->description = $description;
     16▕         $this->observer    = $observer;
     17▕     }

I'm using php 8. If I understand correctly, this error occurs because of this deprecation. Either $description needs to be required (no default value), or $observer should have a default value.

Note, the exception does not occur with simple queries (ie, non-prepared). Any chance of getting this updated for php 8?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions