<?php
namespace Claromentis\Core\Plugin;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array();
use Claromentis\Core\Event\Event;
use Claromentis\Core\Event\EventSources;
use Throwable;









class PluginStatusEvent extends Event
{
    
    
    
    
    protected string $code;
    
    
    
    
    
    
    
    protected int $intendedStatus;
    
    
    
    
    
    
    protected int $previousStatus;
    
    
    
    
    
    
    protected int $status;
    
    
    
    
    
    
    protected string $source;
    
    
    
    
    
    
    protected ?Throwable $throwable;
    public function __construct(string $code, int $_6c40c95e1e1917386016d93d6261f85d, int $_c87518f15b2c098ea498f3404e7d3ff9, int $status, string $_d0845bff5cd0ddb5ed1d7bd9db996f51 = '', Throwable $throwable = null)
    {
        Statuses::assertEnabledOrDisabled($_6c40c95e1e1917386016d93d6261f85d);
        Statuses::validateStatuses($_c87518f15b2c098ea498f3404e7d3ff9, $status);
        $this->code = $code;
        $this->intendedStatus = $_6c40c95e1e1917386016d93d6261f85d;
        $this->previousStatus = $_c87518f15b2c098ea498f3404e7d3ff9;
        $this->status = $status;
        $this->source = $_d0845bff5cd0ddb5ed1d7bd9db996f51;
        $this->throwable = $throwable;
    }
    
    
    
    
    
    
    public function getCode() : string
    {
        return $this->code;
    }
    
    
    
    
    
    
    
    
    public function success() : bool
    {
        $_6c40c95e1e1917386016d93d6261f85d = $this->getIntendedStatus();
        $_824e5d657c1ef417f7d34e018cafa484 = $this->getStatus();
        return $_6c40c95e1e1917386016d93d6261f85d === Statuses::ENABLED && $_824e5d657c1ef417f7d34e018cafa484 === Statuses::ENABLED || $_6c40c95e1e1917386016d93d6261f85d === Statuses::DISABLED && $_824e5d657c1ef417f7d34e018cafa484 === Statuses::DISABLED;
    }
    
    
    
    
    
    
    
    
    public function statusDidChange() : bool
    {
        $_c87518f15b2c098ea498f3404e7d3ff9 = $this->getPreviousStatus();
        $_824e5d657c1ef417f7d34e018cafa484 = $this->getStatus();
        return $_c87518f15b2c098ea498f3404e7d3ff9 !== $_824e5d657c1ef417f7d34e018cafa484;
    }
    
    
    
    
    
    
    
    public function getIntendedStatus() : int
    {
        return $this->intendedStatus;
    }
    
    
    
    
    
    
    public function getIntendedStatusName() : string
    {
        return Statuses::getStatusName($this->intendedStatus);
    }
    
    
    
    
    
    
    
    public function getPreviousStatus() : int
    {
        return $this->previousStatus;
    }
    
    
    
    
    
    
    public function getPreviousStatusName() : string
    {
        return Statuses::getStatusName($this->previousStatus);
    }
    
    
    
    
    
    
    
    public function getStatus() : int
    {
        return $this->status;
    }
    
    
    
    
    
    
    public function getStatusName() : string
    {
        return Statuses::getStatusName($this->status);
    }
    
    
    
    
    
    
    
    
    
    public function getSource() : string
    {
        return $this->source;
    }
    
    
    
    
    
    
    
    
    public function getThrowable() : ?Throwable
    {
        return $this->throwable;
    }
}