Skip to content

Commit

Permalink
Merge pull request #24 from KarlsonComplete/add-docker-structure
Browse files Browse the repository at this point in the history
- Правки на scope
  • Loading branch information
mesilov authored Dec 3, 2024
2 parents a27c75e + 9e936c7 commit 899cae3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
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 @@ public function __construct(
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.

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 @@ public function getApplicationVersion(): int
#[\Override]
public function getApplicationScope(): Scope
{
return new Scope($this->applicationScope);
// return $this->applicationScope;
return $this->applicationScope;
}

/**
Expand Down Expand Up @@ -346,10 +344,6 @@ public function getComment(): ?string
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

0 comments on commit 899cae3

Please sign in to comment.