code: private static function daysPerYear($year, $basis = 0)
      {
          switch ($basis) {
              case 0:
              case 2:
              case 4:
                  $daysPerYear = 360;
  
                  break;
              case 3:
                  $daysPerYear = 365;
  
                  break;
              case 1:
                  $daysPerYear = (DateTime::isLeapYear($year)) ? 366 : 365;
  
                  break;
              default:
                  return Functions::NAN();
          }
  
          return $daysPerYear;
      }
docs: daysPerYear.
  
  Returns the number of days in a specified year, as defined by the "basis" value
  
  @param int $year The year against which we're testing
  @param int $basis The type of day count:
  0 or omitted US (NASD)    360
  1                        Actual (365 or 366 in a leap year)
  2                        360
  3                        365
  4                        European 360
  
  @return int