Skip to content

Commit

Permalink
Fixed cs and stan
Browse files Browse the repository at this point in the history
  • Loading branch information
bckp committed Nov 22, 2023
1 parent 6e6fa3e commit b96df0b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ install:
qa: phpstan cs

cs:
vendor/bin/phpcs --standard=vendor/gamee/php-code-checker-rules/ruleset.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src
composer phpcs

csf:
vendor/bin/phpcbf --standard=vendor/gamee/php-code-checker-rules/ruleset.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src
composer fix-style

phpstan:
vendor/bin/phpstan analyse src
Expand Down
7 changes: 6 additions & 1 deletion src/DI/Helpers/ExchangesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function getConfigSchema(): Schema
);
}

public function getExchangeSchema(): Schema {
public function getExchangeSchema(): Schema
{
return Expect::structure([
'connection' => Expect::string('default'),
'type' => Expect::anyOf(...self::ExchangeTypes)->default(self::ExchangeTypes[0]),
Expand Down Expand Up @@ -73,6 +74,10 @@ public function getExchangeSchema(): Schema {
])->castTo('array');
}

/**
* @param array<string, mixed> $data
* @return array<string, mixed>
*/
public function processConfiguration(array $data): array
{
return (new Processor)->process($this->getExchangeSchema(), $data);
Expand Down
7 changes: 4 additions & 3 deletions src/DI/Helpers/QueuesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public function getConfigSchema(): Schema
);
}

public function getQueueSchema(): Schema {
public function getQueueSchema(): Schema
{
return Expect::structure([
'connection' => Expect::string('default'),
'passive' => Expect::bool(false),
Expand All @@ -45,8 +46,8 @@ public function getQueueSchema(): Schema {
}

/**
* @param array $data
* @return array{connection: string, passive: bool, durable: bool, exclusive: bool, autoDelete: bool, noWait: bool, arguments: array, dlx: int[], autoCreate: int}
* @param array<string, mixed> $data
* @return array{connection: string, passive: bool, durable: bool, exclusive: bool, autoDelete: bool, noWait: bool, arguments: array<string, mixed>, dlx: int[], autoCreate: int}
*/
public function processConfiguration(array $data): array
{
Expand Down
3 changes: 3 additions & 0 deletions src/DI/RabbitMQExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ protected function processConfig(PhpGenerator $generator, mixed &$item): void
}
}

/**
* @param array<string, mixed> $config
*/
protected function processExtensions(array &$config): void
{
foreach ($config['queues'] ?? [] as $name => $data) {
Expand Down

0 comments on commit b96df0b

Please sign in to comment.