Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

### Changed
* ❗️Batch interface `BatchInterface` [renamed](https://github.com/mesilov/bitrix24-php-sdk/issues/324) to `Bitrix24\SDK\Core\Contracts\BatchOperationsInterface`

### Bugfix
* fix [typehint at ContactItemResult](https://github.com/mesilov/bitrix24-php-sdk/issues/320)
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Bitrix24\SDK\Core\Commands\Command;
use Bitrix24\SDK\Core\Commands\CommandCollection;
use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Contracts\CoreInterface;
use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException;
Expand All @@ -23,7 +23,7 @@
*
* @package Bitrix24\SDK\Core
*/
class Batch implements BatchInterface
class Batch implements BatchOperationsInterface
{
private CoreInterface $core;
private LoggerInterface $logger;
Expand Down
12 changes: 6 additions & 6 deletions src/Core/BulkItemsReader/BulkItemsReaderBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
namespace Bitrix24\SDK\Core\BulkItemsReader;

use Bitrix24\SDK\Core\BulkItemsReader\ReadStrategies\FilterWithBatchWithoutCountOrder;
use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Contracts\BulkItemsReaderInterface;
use Bitrix24\SDK\Core\Contracts\CoreInterface;
use Psr\Log\LoggerInterface;

class BulkItemsReaderBuilder
{
protected CoreInterface $core;
protected BatchInterface $batch;
protected BatchOperationsInterface $batch;
protected LoggerInterface $logger;
protected BulkItemsReaderInterface $readStrategy;

/**
* @param \Bitrix24\SDK\Core\Contracts\CoreInterface $core
* @param \Bitrix24\SDK\Core\Contracts\BatchInterface $batch
* @param \Psr\Log\LoggerInterface $logger
* @param \Bitrix24\SDK\Core\Contracts\CoreInterface $core
* @param \Bitrix24\SDK\Core\Contracts\BatchOperationsInterface $batch
* @param \Psr\Log\LoggerInterface $logger
*/
public function __construct(CoreInterface $core, BatchInterface $batch, LoggerInterface $logger)
public function __construct(CoreInterface $core, BatchOperationsInterface $batch, LoggerInterface $logger)
{
$this->core = $core;
$this->batch = $batch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

namespace Bitrix24\SDK\Core\BulkItemsReader\ReadStrategies;

use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Contracts\BulkItemsReaderInterface;
use Generator;
use Psr\Log\LoggerInterface;

class FilterWithBatchWithoutCountOrder implements BulkItemsReaderInterface
{
private BatchInterface $batch;
private BatchOperationsInterface $batch;
private LoggerInterface $log;

/**
* @param \Bitrix24\SDK\Core\Contracts\BatchInterface $batch
* @param \Psr\Log\LoggerInterface $log
* @param \Bitrix24\SDK\Core\Contracts\BatchOperationsInterface $batch
* @param \Psr\Log\LoggerInterface $log
*/
public function __construct(BatchInterface $batch, LoggerInterface $log)
public function __construct(BatchOperationsInterface $batch, LoggerInterface $log)
{
$this->batch = $batch;
$this->log = $log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
use Generator;

/**
* Interface BatchInterface
* Interface BatchOperationsInterface
*
* @package Bitrix24\SDK\Core\Contracts
*/
interface BatchInterface
interface BatchOperationsInterface
{
/**
* Batch wrapper for *.list methods without counting elements on every api-call
Expand Down
10 changes: 5 additions & 5 deletions src/Services/AbstractBatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Bitrix24\SDK\Services;

use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Psr\Log\LoggerInterface;

/**
Expand All @@ -14,16 +14,16 @@
*/
abstract class AbstractBatchService
{
protected BatchInterface $batch;
protected BatchOperationsInterface $batch;
protected LoggerInterface $log;

/**
* Batch constructor.
*
* @param BatchInterface $batch
* @param LoggerInterface $log
* @param BatchOperationsInterface $batch
* @param LoggerInterface $log
*/
public function __construct(BatchInterface $batch, LoggerInterface $log)
public function __construct(BatchOperationsInterface $batch, LoggerInterface $log)
{
$this->batch = $batch;
$this->log = $log;
Expand Down
8 changes: 4 additions & 4 deletions src/Services/AbstractServiceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Bitrix24\SDK\Services;


use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Contracts\BulkItemsReaderInterface;
use Bitrix24\SDK\Core\Contracts\CoreInterface;
use Psr\Log\LoggerInterface;
Expand All @@ -18,7 +18,7 @@
abstract class AbstractServiceBuilder
{
protected CoreInterface $core;
protected BatchInterface $batch;
protected BatchOperationsInterface $batch;
protected BulkItemsReaderInterface $bulkItemsReader;
protected LoggerInterface $log;
protected array $serviceCache;
Expand All @@ -27,13 +27,13 @@ abstract class AbstractServiceBuilder
* AbstractServiceBuilder constructor.
*
* @param CoreInterface $core
* @param BatchInterface $batch
* @param BatchOperationsInterface $batch
* @param \Bitrix24\SDK\Core\Contracts\BulkItemsReaderInterface $bulkItemsReader
* @param LoggerInterface $log
*/
public function __construct(
CoreInterface $core,
BatchInterface $batch,
BatchOperationsInterface $batch,
BulkItemsReaderInterface $bulkItemsReader,
LoggerInterface $log
) {
Expand Down
10 changes: 5 additions & 5 deletions src/Services/CRM/Deal/Service/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Bitrix24\SDK\Services\CRM\Deal\Service;

use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Result\AddedItemBatchResult;
use Bitrix24\SDK\Core\Result\DeletedItemBatchResult;
Expand All @@ -20,16 +20,16 @@
*/
class Batch
{
protected BatchInterface $batch;
protected BatchOperationsInterface $batch;
protected LoggerInterface $log;

/**
* Batch constructor.
*
* @param BatchInterface $batch
* @param LoggerInterface $log
* @param BatchOperationsInterface $batch
* @param LoggerInterface $log
*/
public function __construct(BatchInterface $batch, LoggerInterface $log)
public function __construct(BatchOperationsInterface $batch, LoggerInterface $log)
{
$this->batch = $batch;
$this->log = $log;
Expand Down
10 changes: 5 additions & 5 deletions src/Services/CRM/Lead/Service/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Bitrix24\SDK\Services\CRM\Lead\Service;

use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Result\AddedItemBatchResult;
use Bitrix24\SDK\Core\Result\DeletedItemBatchResult;
Expand All @@ -19,16 +19,16 @@
*/
class Batch
{
protected BatchInterface $batch;
protected BatchOperationsInterface $batch;
protected LoggerInterface $log;

/**
* Batch constructor.
*
* @param BatchInterface $batch
* @param LoggerInterface $log
* @param BatchOperationsInterface $batch
* @param LoggerInterface $log
*/
public function __construct(BatchInterface $batch, LoggerInterface $log)
public function __construct(BatchOperationsInterface $batch, LoggerInterface $log)
{
$this->batch = $batch;
$this->log = $log;
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Stubs/NullBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Bitrix24\SDK\Tests\Unit\Stubs;

use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Response\DTO\ResponseData;
use Generator;
Expand All @@ -14,7 +14,7 @@
*
* @package Bitrix24\SDK\Tests\Unit\Stubs
*/
class NullBatch implements BatchInterface
class NullBatch implements BatchOperationsInterface
{

/**
Expand Down
4 changes: 2 additions & 2 deletions tools/PerformanceBenchmarks/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Bitrix24\SDK\Tools\PerformanceBenchmarks;

use Bitrix24\SDK\Core\Batch;
use Bitrix24\SDK\Core\Contracts\BatchInterface;
use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface;
use Bitrix24\SDK\Core\Contracts\CoreInterface;
use Bitrix24\SDK\Core\CoreBuilder;
use Bitrix24\SDK\Core\Credentials\Credentials;
Expand Down Expand Up @@ -34,7 +34,7 @@ class ListCommand extends Command
{
protected LoggerInterface $logger;
protected CoreInterface $core;
protected BatchInterface $batch;
protected BatchOperationsInterface $batch;
/**
* @var string
*/
Expand Down