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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.11.0-alpha1, 1.11.0
    • None
    • None

    Description

      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
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: