[Config] General: Add return and parameter types

Review Request #739 — Created Feb. 19, 2021 and submitted

smillernl
Lunr.Config
feature/general/types
738
lunr
General: Add return and parameter types


  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
pprkut
  1. 
      
  2. src/Lunr/Core/Configuration.php (Diff revision 1)
     
     

    key() defines its return types as int|string|null.

    null can't be success and failure value.

    1. null is a failure value coming from key(): "If the internal pointer points beyond the end of the elements list or the array is empty, key() returns null."

    2. No, I get that :)

      Your initial comment lists null twice though, once as success value, and once as failure value.

    3. Well it was meant as

      @return {string|float|int|bool|null} {scalar on success, or null on failure}.

      I don't think we usually split values out of the initial type definition into the description right?

    4. oh boy

      Nevermind me then. It's Friday...

      but float and bool are still not valid types, so those should go

  3. 
      
smillernl
Review request changed

Status: Closed (submitted)

Loading...