This repository has been archived on 2025-07-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
atol-online/src/Exceptions/AtolException.php
AnthonyAxenov 3bf8667437 Рефакторинг исключений, новые константы ограничений
Описывать все слишком долго, TLDR:
- упрощены корневые AtolException, {BasicTooLongException => TooLongException}, {BasicTooManyException => TooManyException}
- InvalidSnoException заменён на InvalidEnumValueException
- добавлены новые константы, общий порядок изменён в соответствии с порядком упоминания в документации, ссылки на которую тоже добавлены с указанием страниц

Помимо этого, в enum-ах теперь должен быть предусмотрен метод getFfdTags()
2021-11-22 14:51:10 +08:00

39 lines
1002 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
*
* This code is licensed under MIT.
* Этот код распространяется по лицензии MIT.
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
*/
declare(strict_types = 1);
namespace AtolOnline\Exceptions;
use Exception;
/**
* Исключение, возникающее при работе с АТОЛ Онлайн
*/
class AtolException extends Exception
{
/**
* @var int[] Теги ФФД
*/
protected array $ffd_tags = [];
/**
* Конструктор
*
* @param string $message Сообщение
* @param int[] $ffd_tags Переопредление тегов ФФД
*/
public function __construct(string $message = '', array $ffd_tags = [])
{
parent::__construct(
($message ?: $this->message) . ' [Теги ФФД: ' . implode(', ', $ffd_tags ?: $this->ffd_tags) . ']'
);
}
}