Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1933

Add return type to arginfo for Iterator and Countable methods in PHP 8.1

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.11.0-alpha1, 1.11.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Classes that implement Iterator and Countable will need return type information added to arginfo of relevant methods:

      Deprecated: Return type of MongoDB\Driver\BulkWrite::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
      
      Deprecated: Return type of MongoDB\Driver\Cursor::current() should either be compatible with Iterator::current(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
      
      Deprecated: Return type of MongoDB\Driver\Cursor::next() should either be compatible with Iterator::next(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
      
      Deprecated: Return type of MongoDB\Driver\Cursor::key() should either be compatible with Iterator::key(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
      
      Deprecated: Return type of MongoDB\Driver\Cursor::valid() should either be compatible with Iterator::valid(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
      
      Deprecated: Return type of MongoDB\Driver\Cursor::rewind() should either be compatible with Iterator::rewind(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: