* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ namespace PrestaShop\Module\AutoUpgrade\Exceptions; use Exception; class UpgradeException extends Exception { const SEVERITY_ERROR = 1; const SEVERITY_WARNING = 2; /** * @var string[] */ private $quickInfos = []; /** * @var int */ private $severity = self::SEVERITY_ERROR; /** * @return string[] */ public function getQuickInfos(): array { if ($this->getPrevious()) { return array_merge( [(string) $this->getPrevious()], $this->quickInfos ); } return $this->quickInfos; } public function getSeverity(): int { return $this->severity; } public function addQuickInfo(string $quickInfo): UpgradeException { $this->quickInfos[] = $quickInfo; return $this; } /** * @param string[] $quickInfos * * @return $this */ public function setQuickInfos(array $quickInfos): UpgradeException { $this->quickInfos = $quickInfos; return $this; } public function setSeverity(int $severity): UpgradeException { $this->severity = $severity; return $this; } }