code: public function allNumberFormats(Spreadsheet $spreadsheet)
      {
          // Get an array of unique number formats
          $aNumFmts = [];
          $aStyles = $this->allStyles($spreadsheet);
  
          /** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
          foreach ($aStyles as $style) {
              if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !isset($aNumFmts[$style->getNumberFormat()->getHashCode()])) {
                  $aNumFmts[$style->getNumberFormat()->getHashCode()] = $style->getNumberFormat();
              }
          }
  
          return $aNumFmts;
      }
docs: Get an array of all number formats.
  
  @param Spreadsheet $spreadsheet
  
  @return NumberFormat[] All number formats in PhpSpreadsheet