Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code style #166

Open
wants to merge 5 commits into
base: 0.6.x
Choose a base branch
from
Open

Conversation

tomas-novotny
Copy link
Contributor

@tomas-novotny tomas-novotny commented Feb 21, 2025

Better code style with phpcbf and rector tools.

  • add param and return types everywhere
  • add missing visibility
  • replace " -> '
  • fix imports
  • updated spec/generate.php to match generated code with code style format.

Cleanup composer dependencies with composer-dependency-analyser

Updated phpstan/phpstan: ^2.0 with raised level to 5 -> 7

  • add better typehints to callable, array, promises, etc.
-/** @var callable[] */
+/** @var list<callable(\Bunny\Message, \Bunny\Protocol\MethodBasicReturnFrame): void> */
private array $returnCallbacks = [];
  • fix return types of generated methods (remove bool if method never returns it)
-public function qos(int $prefetchSize = 0, int $prefetchCount = 0, bool $global = false): bool|Protocol\MethodBasicQosOkFrame
+public function qos(int $prefetchSize = 0, int $prefetchCount = 0, bool $global = false): Protocol\MethodBasicQosOkFrame
  • add missing methods to ClientInterface
+public function exchangeDeclare(string $exchange, string $exchangeType = 'direct', bool $passive = false, bool $durable = false, bool $autoDelete = false, bool $internal = false, bool $nowait = false, array $arguments = []): bool|Protocol\MethodExchangeDeclareOkFrame;
+public function exchangeDelete(string $exchange, bool $ifUnused = false, bool $nowait = false): bool|MethodExchangeDeleteOkFrame;
+public function exchangeBind(string $destination, string $source, string $routingKey = '', bool $nowait = false, array $arguments = []): bool|MethodExchangeBindOkFrame;
+public function exchangeUnbind(string $destination, string $source, string $routingKey = '', bool $nowait = false, array $arguments = []): bool|MethodExchangeUnbindOkFrame;
+public function recoverAsync(bool $requeue = false): bool;
+public function recover(bool $requeue = false): bool|MethodBasicRecoverOkFrame;
  • remove getOkFrame and getDeferred from Channel - it was never used, removed in b295581
-private ?MethodBasicGetOkFrame $getOkFrame = null;
-private ?Deferred $getDeferred = null;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant