Миграция на php8.1

* enum-ы теперь enum-ы, а не говно -- теперь всё переведено на них, где это было возможно
* некоторые свойства классов объявлены в конструкторе
* некоторые классы перемещены в корневой неймспейс
* исправлен код-стайл, вычищен некоторый мусор, выправлены тесты... работы над этим продолжаются
This commit is contained in:
2022-12-15 00:19:55 +08:00
parent 692ae43f9f
commit 4157ab68f5
120 changed files with 1098 additions and 1401 deletions

View File

@@ -1,4 +1,5 @@
<?php
/*
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
*
@@ -7,11 +8,11 @@
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
*/
declare(strict_types = 1);
declare(strict_types=1);
namespace AtolOnline\Api;
use AtolOnline\Constants\Constraints;
use AtolOnline\Constraints;
use AtolOnline\Exceptions\{
AuthFailedException,
EmptyLoginException,

View File

@@ -1,4 +1,5 @@
<?php
/*
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
*
@@ -9,7 +10,7 @@
/** @noinspection PhpMultipleClassDeclarationsInspection */
declare(strict_types = 1);
declare(strict_types=1);
namespace AtolOnline\Api;
@@ -36,7 +37,7 @@ final class AtolResponse implements JsonSerializable, Stringable
/**
* @var object|array|null Содержимое ответа сервера
*/
protected object|array|null $content;
protected object | array | null $content;
/**
* @var array Заголовки ответа
@@ -122,7 +123,8 @@ final class AtolResponse implements JsonSerializable, Stringable
/**
* @inheritDoc
*/
#[ArrayShape([
#[ArrayShape(
[
'code' => 'int',
'headers' => 'array|\string[][]',
'body' => 'mixed',

View File

@@ -1,4 +1,5 @@
<?php
/*
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
*
@@ -7,12 +8,12 @@
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
*/
declare(strict_types = 1);
declare(strict_types=1);
namespace AtolOnline\Api;
use AtolOnline\{
Constants\Constraints,
Constraints,
TestEnvParams};
use AtolOnline\Entities\{
Correction,
@@ -320,7 +321,7 @@ final class Fiscalizer extends AtolClient
*/
protected function registerDocument(
string $api_method,
Receipt|Correction $document,
Receipt | Correction $document,
?string $external_id = null
): ?AtolResponse {
$this->isTestMode() && $document->getCompany()

View File

@@ -1,4 +1,5 @@
<?php
/*
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
*
@@ -7,7 +8,7 @@
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
*/
declare(strict_types = 1);
declare(strict_types=1);
namespace AtolOnline\Api;
@@ -88,7 +89,7 @@ final class Monitor extends AtolClient
public function getAll(?int $limit = null, ?int $offset = null): Collection
{
$collection = collect($this->fetchAll($limit, $offset)->getContent());
return $collection->map(fn($data) => new Kkt($data));
return $collection->map(fn ($data) => new Kkt($data));
}
/**