<commit_before><?php

/**
 * Helper class used to check the validity
 * of a Maestrano session
 */
class Maestrano_Sso_Session extends Maestrano_Util_PresetObject
{
  private $httpSession = null;
  private $uid = '';
  private $groupUid = '';
  private $sessionToken = '';
  private $recheck = null;
  protected $preset;

  /**
   * Construct the Maestrano_Sso_Session object
   */
  public function __construct(&$http_session, $user = null)
  {
    // Populate attributes from params
    $this->httpSession = &$http_session;

    if ($user != null) {
      // Setup the session with $user
      $this->uid = $user->getUid();
      $this->groupUid = $user->getGroupUid();
      $this->sessionToken = $user->getSsoSession();
      $this->recheck = $user->getSsoSessionRecheck();
    } else if ($this->ssoTokenExists()) {
      // Get maestrano sso token
      $mnoEntry = $this->httpSession['maestrano'];

      if ($mnoEntry != null) {
        // Decode the object
        $sessionObj = base64_decode($mnoEntry);
        $sessionObj = json_decode($sessionObj, true);

        // Setup the session
        $this->uid = $sessionObj['uid'];
        $this->groupUid = $sessionObj["group_uid"];
        $this->sessionToken = $sessionObj['session'];
        $this->recheck = new DateTime($sessionObj['session_recheck']);
      }
    }
  }

  /**
   * @param string $id The ID of the bill to instantiate.
   * @param string|null $apiToken
   *
   * @return Maestrano_Billing_Bill
   */
  public static function newWithPreset($preset, &$http_session, $user = null)
  {
    $obj = new Maestrano_Sso_Session($http_session, $user, $preset);
    $obj->_preset = $preset;<commit_msg>Not possible to pass a reference without creating a new object, so removing the pass by reference instruction<commit_after><?php

/**
 * Helper class used to check the validity
 * of a Maestrano session
 */
class Maestrano_Sso_Session extends Maestrano_Util_PresetObject
{
  private $httpSession = null;
  private $uid = '';
  private $groupUid = '';
  private $sessionToken = '';
  private $recheck = null;
  protected $preset;

  /**
   * Construct the Maestrano_Sso_Session object
   */
  public function __construct(&$http_session, $user = null)
  {
    // Populate attributes from params
    $this->httpSession = &$http_session;

    if ($user != null) {
      // Setup the session with $user
      $this->uid = $user->getUid();
      $this->groupUid = $user->getGroupUid();
      $this->sessionToken = $user->getSsoSession();
      $this->recheck = $user->getSsoSessionRecheck();
    } else if ($this->ssoTokenExists()) {
      // Get maestrano sso token
      $mnoEntry = $this->httpSession['maestrano'];

      if ($mnoEntry != null) {
        // Decode the object
        $sessionObj = base64_decode($mnoEntry);
        $sessionObj = json_decode($sessionObj, true);

        // Setup the session
        $this->uid = $sessionObj['uid'];
        $this->groupUid = $sessionObj["group_uid"];
        $this->sessionToken = $sessionObj['session'];
        $this->recheck = new DateTime($sessionObj['session_recheck']);
      }
    }
  }

  /**
   * @param string $id The ID of the bill to instantiate.
   * @param string|null $apiToken
   *
   * @return Maestrano_Billing_Bill
   */
  public static function newWithPreset($preset, $http_session, $user = null)
  {
    $obj = new Maestrano_Sso_Session($http_session, $user, $preset);
    $obj->_preset = $preset;
{'fraction_non_alphanumeric': 0.13915574963609897, 'fraction_numerical': 0.0011644832605531296, 'mean_word_length': 3.100238663484487, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '6468714', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1077, 'n_words': 260}