original_string: public static function now(?string $timezone = null): DateTime
      {
          $timezone = $timezone ?: date_default_timezone_get();
          assert(Validate::isTimezone($timezone), sprintf('Invalid timezone: %s', $timezone));
  
          $dateTime = new DateTimeImmutable('now', new DateTimeZone($timezone));
          $year = (int) $dateTime->format('Y');
          $month = (int) $dateTime->format('n');
          $day = (int) $dateTime->format('j');
          $hour = (int) $dateTime->format('G');
          $minute = (int) $dateTime->format('i');
          $second = (int) $dateTime->format('s');
  
          return new static(
              Date::create($year, $month, $day),
              Time::create($hour, $minute, $second),
              Timezone::create($timezone)
          );
      }
code: public static function now(?string $timezone = null): DateTime
      {
          $timezone = $timezone ?: date_default_timezone_get();
          assert(Validate::isTimezone($timezone), sprintf('Invalid timezone: %s', $timezone));
  
          $dateTime = new DateTimeImmutable('now', new DateTimeZone($timezone));
          $year = (int) $dateTime->format('Y');
          $month = (int) $dateTime->format('n');
          $day = (int) $dateTime->format('j');
          $hour = (int) $dateTime->format('G');
          $minute = (int) $dateTime->format('i');
          $second = (int) $dateTime->format('s');
  
          return new static(
              Date::create($year, $month, $day),
              Time::create($hour, $minute, $second),
              Timezone::create($timezone)
          );
      }
code_tokens: public static function now ( ? string $ timezone = null ) : DateTime { $ timezone = $ timezone ? : date_default_timezone_get ( ) ; assert ( Validate :: isTimezone ( $ timezone ) , sprintf ( 'Invalid timezone: %s' , $ timezone ) ) ; $ dateTime = new DateTimeImmutable ( 'now' , new DateTimeZone ( $ timezone ) ) ; $ year = ( int ) $ dateTime -> format ( 'Y' ) ; $ month = ( int ) $ dateTime -> format ( 'n' ) ; $ day = ( int ) $ dateTime -> format ( 'j' ) ; $ hour = ( int ) $ dateTime -> format ( 'G' ) ; $ minute = ( int ) $ dateTime -> format ( 'i' ) ; $ second = ( int ) $ dateTime -> format ( 's' ) ; return new static ( Date :: create ( $ year , $ month , $ day ) , Time :: create ( $ hour , $ minute , $ second ) , Timezone :: create ( $ timezone ) ) ; }
docstring: Creates instance for the current date and time
  
  @param string|null $timezone The timezone string or null for default
  
  @return DateTime
docstring_tokens: Creates instance for the current date and time