Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ name: Check code style and tests
- master
jobs:

build_8_0:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php_version:
- '8.4'
- '8.5'

steps:

- uses: actions/checkout@v2
- uses: php-actions/composer@v6
with:
php_version: 8.0
version: 2
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: ${{ matrix.php_version }}

- name: Update packages
run: sudo composer update
run: composer update --prefer-dist --no-interaction

- name: PHP version
run: php -v
Expand All @@ -34,8 +36,4 @@ jobs:
run: vendor/bin/phpcs

- name: Run tests
uses: php-actions/phpunit@v3
with:
version: 9
php_version: 8.0

run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vendor/
composer.lock
src/Clients/getDeviceUUID
.idea
.idea.phpunit.result.cache
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PHP библиотека для упрощённого взаимодейтсв

### Зависимости

* PHP версии 7.3 или выше
* PHP версии 8.4 или выше
* [psr/log](https://github.com/php-fig/log)
* [ext-json](http://php.net/manual/ru/json.installation.php)
* [ext-simplexml](http://php.net/manual/ru/simplexml.installation.php)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["mindbox", "sdk"],
"type": "library",
"require": {
"php": ">=8.0",
"php": ">=8.4",
"psr/log": "^1.1|^2|^3",
"ext-json": "*",
"ext-simplexml": "*",
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Системные зависимости

* PHP версии 7.3 или выше
* PHP версии 8.4 или выше
* [psr/log](https://github.com/php-fig/log)
* [ext-json](http://php.net/manual/ru/json.installation.php)
* [ext-simplexml](http://php.net/manual/ru/simplexml.installation.php)
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<file>src/</file>
<file>tests/</file>
<arg value="spn" />
<rule ref="PSR2" />
<rule ref="PSR12" />
</ruleset>
4 changes: 2 additions & 2 deletions src/Clients/AbstractMindboxClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function __construct($secretKey, IHttpClient $httpClient, LoggerInterface
public function prepareRequest(
$method,
$operationName,
\Mindbox\DTO\DTO $body = null,
?\Mindbox\DTO\DTO $body = null,
$additionalUrl = '',
$queryParams = [],
$isSync = true,
Expand Down Expand Up @@ -211,7 +211,7 @@ abstract protected function prepareAuthorizationHeader();
*
* @return string
*/
abstract protected function prepareBody(\Mindbox\DTO\DTO $body = null);
abstract protected function prepareBody(?\Mindbox\DTO\DTO $body = null);

/**
* Инициализация экземпляра запроса.
Expand Down
1 change: 0 additions & 1 deletion src/Clients/MindboxClientFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\Clients;

use Mindbox\XMLHelper\MindboxXMLSerializer;
Expand Down
3 changes: 1 addition & 2 deletions src/Clients/MindboxClientV2.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\Clients;

use Mindbox\DTO\DTO;
Expand Down Expand Up @@ -126,7 +125,7 @@ protected function prepareAuthorizationHeader()
*
* @return string
*/
protected function prepareBody(DTO $body = null)
protected function prepareBody(?DTO $body = null)
{
return $body ? $body->toXML() : '';
}
Expand Down
3 changes: 1 addition & 2 deletions src/Clients/MindboxClientV3.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\Clients;

use Mindbox\HttpClients\IHttpClient;
Expand Down Expand Up @@ -149,7 +148,7 @@ protected function prepareAuthorizationHeader()
*
* @return string
*/
protected function prepareBody(\Mindbox\DTO\DTO $body = null)
protected function prepareBody(?\Mindbox\DTO\DTO $body = null)
{
return $body ? $body->toJson() : '';
}
Expand Down
1 change: 0 additions & 1 deletion src/DTO/DTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO;

use ArrayAccess;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/DTOCollection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO;

/**
Expand Down
1 change: 0 additions & 1 deletion src/DTO/ResultDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO;

use Mindbox\DTO\V3\Responses\OrderResponseCollection;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/CustomFieldDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2;

/**
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/IdentityDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2;

/**
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/LineDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/OrderDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/Responses/LineResponseCollection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2\Responses;

use Mindbox\DTO\DTOCollection;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/Responses/LineResponseDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2\Responses;

use Mindbox\DTO\V2\LineDTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/Responses/OrderResponseCollection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2\Responses;

use Mindbox\DTO\DTOCollection;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V2/Responses/OrderResponseDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V2\Responses;

use Mindbox\DTO\V2\OrderDTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/AreaDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/CustomFieldDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

/**
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/CustomerDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

/**
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/CustomerIdentityDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/DiscountDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/IdentityDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

/**
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/LineDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/OperationDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/OrderDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/PaymentDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/ProductDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

/**
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/ProductIdentityDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/ProductListItemDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/Requests/AddProductToListRequestDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/Requests/AreaRequestDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\V3\AreaDTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/Requests/CategoryRequestCollection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\DTOCollection;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/Requests/CategoryRequestDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\DTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/Requests/CustomFieldRequestDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\V3\CustomFieldDTO;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/Requests/CustomerIdentityRequestCollection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\DTOCollection;
Expand Down
1 change: 0 additions & 1 deletion src/DTO/V3/Requests/CustomerIdentityRequestDTO.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\V3\CustomerIdentityDTO;
Expand Down
Loading