HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/proc/self/cwd/wp-content/plugins/cornerstone/includes/classes/Parsy/Util/Token.php
<?php


namespace Themeco\Cornerstone\Parsy\Util;

use Themeco\Cornerstone\Parsy\Serializer;

class Token implements \JsonSerializable {
  protected $type;
  protected $content = null;

  public function __construct($type, $content = null) {
    $this->type = $type;
    $this->content = $content;
  }

  public function content() {
    return $this->content;
  }

  public function setContent($content) {
    $this->content = $content;
  }

  public function type() {
    return $this->type;
  }

  public function is($type) {
    return $this->type === $type;
  }

  #[\ReturnTypeWillChange]
  public function jsonSerialize() {
    if (Serializer::isActive()) {
      $type = Serializer::index($this->type);
      return [ $type => $this->content ];
    }
    return [ 'node' => $this->type, 'content' => $this->content ];
  }

}