Skip to content

Commit

Permalink
Merge pull request #54 from systopia/code-style
Browse files Browse the repository at this point in the history
Code style
  • Loading branch information
dontub authored Jan 23, 2024
2 parents befe362 + 3429633 commit 6b851c9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Civi/Civioffice/CiviofficeSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,33 @@

final class CiviofficeSession {

private static ?self $instance = null;
private static ?self $instance = NULL;

private \CRM_Core_Session $session;

public static function getInstance(): self {
return self::$instance ??= new self(\CRM_Core_Session::singleton());
// @phpstan-ignore-next-line
return self::$instance ??= new self(\CRM_Core_Session::singleton());
}

public function __construct(?\CRM_Core_Session $session) {
$this->session = $session;
public function __construct(\CRM_Core_Session $session) {
$this->session = $session;
}

/**
* @see storeTempFolderPath()
*/
public function getTempFolderPath(string $hash): ?string {
return $this->session->get('temp_' . $hash, 'civioffice');
// @phpstan-ignore-next-line
return $this->session->get('temp_' . $hash, 'civioffice');
}

/**
* @see storeTempFolderPath()
*/
public function removeTempFolderPath(string $temp_folder_path): void {
$hash = sha1($temp_folder_path);
$this->session->set('temp_' . $hash, null, 'civioffice');
$hash = sha1($temp_folder_path);
$this->session->set('temp_' . $hash, NULL, 'civioffice');
}

/**
Expand All @@ -57,4 +59,5 @@ public function storeTempFolderPath(string $temp_folder_path): string {

return $hash;
}

}

0 comments on commit 6b851c9

Please sign in to comment.