<commit_before><?php

namespace Drupal\effective_activism\Helper;

use Drupal;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\effective_activism\Entity\Organization;
use Drupal\effective_activism\Entity\Group;
use Drupal\effective_activism\Constant;

/**
 * Helper functions for event dates.
 */
class DateHelper {

  /**
   * Returns now relative to organization or group timezone.
   *
   * @param \Drupal\effective_activism\Entity\Organization $organization
   *   The organization.
   * @param \Drupal\effective_activism\Entity\Group $group
   *   The group.
   *
   * @return \Drupal\Core\Datetime\DrupalDateTime
   *   A DrupalDateTime object of 'now' relative to the proper timezone.
   */
  public static function getNow(Organization $organization, Group $group = NULL) {
    $timezone = (!empty($group) && $group->timezone->value !== Constant::GROUP_INHERIT_TIMEZONE) ? $group->timezone->value : $organization->timezone->value;
    return new DrupalDateTime('now', $timezone);
  }

}<commit_msg>AFA-233 Code style fixes<commit_after><?php

namespace Drupal\effective_activism\Helper;

use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\effective_activism\Entity\Organization;
use Drupal\effective_activism\Entity\Group;
use Drupal\effective_activism\Constant;

/**
 * Helper functions for event dates.
 */
class DateHelper {

  /**
   * Returns now relative to organization or group timezone.
   *
   * @param \Drupal\effective_activism\Entity\Organization $organization
   *   The organization.
   * @param \Drupal\effective_activism\Entity\Group $group
   *   The group.
   *
   * @return \Drupal\Core\Datetime\DrupalDateTime
   *   A DrupalDateTime object of 'now' relative to the proper timezone.
   */
  public static function getNow(Organization $organization, Group $group = NULL) {
    $timezone = (!empty($group) && $group->timezone->value !== Constant::GROUP_INHERIT_TIMEZONE) ? $group->timezone->value : $organization->timezone->value;
    return new DrupalDateTime('now', $timezone);
  }

}
{'fraction_non_alphanumeric': 0.11700545364402579, 'fraction_numerical': 0.001487357461576599, 'mean_word_length': 4.324538258575198, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3276383', 'n_tokens_mistral': 610, 'n_tokens_neox': 614, 'n_words': 137}