Skip to content
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
6 changes: 6 additions & 0 deletions src/AggregateRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
class AggregateRoot implements AggregateRootEventsEmitterInterface
{
protected array $events = [];

public function getEvents(): array
{
return $this->events;
}

public function emitEvents(): array
{
$events = $this->events;
Expand Down
12 changes: 3 additions & 9 deletions src/Bitrix24Accounts/Entity/Bitrix24Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

class Bitrix24Account extends AggregateRoot implements Bitrix24AccountInterface
{
private array|Scope $applicationScope;
private Scope $applicationScope;

private ?string $applicationToken = null;

Expand All @@ -57,8 +57,7 @@
bool $isEmitBitrix24AccountCreatedEvent = false
) {
$this->authToken = $authToken;
$array = $applicationScope->getScopeCodes();
$this->applicationScope = $array;
$this->applicationScope = $applicationScope->getScopeCodes();

Check failure on line 60 in src/Bitrix24Accounts/Entity/Bitrix24Account.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, highest, ubuntu-latest)

Property Bitrix24\Lib\Bitrix24Accounts\Entity\Bitrix24Account::$applicationScope (Bitrix24\SDK\Core\Credentials\Scope) does not accept array.
$this->addAccountCreatedEventIfNeeded($isEmitBitrix24AccountCreatedEvent);
}

Expand Down Expand Up @@ -148,8 +147,7 @@
#[\Override]
public function getApplicationScope(): Scope
{
return new Scope($this->applicationScope);
// return $this->applicationScope;
return $this->applicationScope;
}

/**
Expand Down Expand Up @@ -290,7 +288,7 @@

$this->applicationVersion = $version;
if ($newScope instanceof Scope) {
$this->applicationScope = $newScope->getScopeCodes();

Check failure on line 291 in src/Bitrix24Accounts/Entity/Bitrix24Account.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, highest, ubuntu-latest)

Property Bitrix24\Lib\Bitrix24Accounts\Entity\Bitrix24Account::$applicationScope (Bitrix24\SDK\Core\Credentials\Scope) does not accept array.
}

$this->updatedAt = new CarbonImmutable();
Expand Down Expand Up @@ -346,10 +344,6 @@
return $this->comment;
}

public function getEvents(): array
{
return $this->events;
}

private function addAccountCreatedEventIfNeeded(bool $isEmitCreatedEvent): void
{
Expand Down
4 changes: 1 addition & 3 deletions tests/Functional/Bitrix24Accounts/FetcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ protected function setUp(): void
public function testListReturnsPaginatedResults(): void
{

$bitrix24Account = (new Bitrix24AccountBuilder())
->build()
;
$bitrix24Account = (new Bitrix24AccountBuilder())->build();
$this->repository->save($bitrix24Account);
$this->flusher->flush();

Expand Down
Loading