PHP 8.2.31
Preview: Subject.php Size: 909 B
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Automation/Engine/Data/Subject.php

<?php declare(strict_types = 1);

namespace MailPoet\Automation\Engine\Data;

if (!defined('ABSPATH')) exit;


use MailPoet\Automation\Engine\Utils\Json;

class Subject {
  /** @var string */
  private $key;

  /** @var array */
  private $args;

  public function __construct(
    string $key,
    array $args
  ) {
    $this->key = $key;
    $this->args = $args;
  }

  public function getKey(): string {
    return $this->key;
  }

  public function getArgs(): array {
    return $this->args;
  }

  public function getHash(): string {
    return md5($this->getKey() . serialize($this->getArgs()));
  }

  public function toArray(): array {
    return [
      'key' => $this->getKey(),
      'args' => Json::encode($this->getArgs()),
      'hash' => $this->getHash(),
    ];
  }

  public static function fromArray(array $data): self {
    return new self($data['key'], Json::decode($data['args']));
  }
}

Directory Contents

Dirs: 0 × Files: 13

Name Size Perms Modified Actions
5.84 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
3.06 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
3.96 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.16 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
2.07 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.16 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
0 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
491 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.84 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
3.31 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.83 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
909 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.18 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).