Fix method signature for Serializable::unserialize() implementations

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Unknown
    • 1.16.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In PHP 8, the method signature of Serializable::unserialize changed:

      // PHP < 8
      public function unserialize($serialized);
      
      // PHP >= 8
      public function unserialize(string $data): void;
      

      This causes issues in newer applications about the changed parameter name. Since parameter names have increased significance after the introduction of named arguments, we should implement the correct method signature in all classes implementing the interface. To avoid BC breaks on older platforms where Serializable::unserialize does not have a parameter type, this change can only be made for PHP >= 8.

      Downstream users are not affected, as our implementations of this method are always final.

            Assignee:
            Andreas Braun
            Reporter:
            Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: