Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmy committed Dec 28, 2023
1 parent f2b6241 commit bfc1d65
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
6 changes: 1 addition & 5 deletions pkg/amqp-bunny/AmqpContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class AmqpContext implements InteropAmqpContext, DelayStrategyAware
* Callable must return instance of \Bunny\Channel once called.
*
* @param Channel|callable $bunnyChannel
* @param array $config
*/
public function __construct($bunnyChannel, array $config)
{
Expand Down Expand Up @@ -294,10 +293,7 @@ public function getBunnyChannel(): Channel
if (false == $this->bunnyChannel) {
$bunnyChannel = call_user_func($this->bunnyChannelFactory);
if (false == $bunnyChannel instanceof Channel) {
throw new \LogicException(sprintf(
'The factory must return instance of \Bunny\Channel. It returned %s',
is_object($bunnyChannel) ? get_class($bunnyChannel) : gettype($bunnyChannel)
));
throw new \LogicException(sprintf('The factory must return instance of \Bunny\Channel. It returned %s', is_object($bunnyChannel) ? get_class($bunnyChannel) : gettype($bunnyChannel)));
}

$this->bunnyChannel = $bunnyChannel;
Expand Down
4 changes: 2 additions & 2 deletions pkg/amqp-ext/AmqpConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function receive(int $timeout = 0): ?Message
return $message;
}

usleep(100000); //100ms
usleep(100000); // 100ms
}

return null;
Expand Down Expand Up @@ -130,7 +130,7 @@ public function reject(Message $message, bool $requeue = false): void

$this->getExtQueue()->reject(
$message->getDeliveryTag(),
$requeue ? AMQP_REQUEUE : AMQP_NOPARAM
$requeue ? \AMQP_REQUEUE : \AMQP_NOPARAM
);
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/enqueue/Client/DriverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ public function create(ConnectionFactory $factory, Config $config, RouteCollecti
throw new \LogicException(sprintf('To use given scheme "%s" a package has to be installed. Run "composer req %s" to add it.', $dsn->getScheme(), implode(' ', $driverInfo['packages'])));
}

throw new \LogicException(sprintf(
'A given scheme "%s" is not supported. Maybe it is a custom driver, make sure you registered it with "%s::addDriver".',
$dsn->getScheme(),
Resources::class
));
throw new \LogicException(sprintf('A given scheme "%s" is not supported. Maybe it is a custom driver, make sure you registered it with "%s::addDriver".', $dsn->getScheme(), Resources::class));
}

private function findDriverInfo(Dsn $dsn, array $factories): ?array
Expand Down
8 changes: 2 additions & 6 deletions pkg/redis/PhpRedis.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,14 @@ public function connect(): void

$supportedSchemes = ['redis', 'rediss', 'tcp', 'unix'];
if (false == in_array($this->config['scheme'], $supportedSchemes, true)) {
throw new \LogicException(sprintf(
'The given scheme protocol "%s" is not supported by php extension. It must be one of "%s"',
$this->config['scheme'],
implode('", "', $supportedSchemes)
));
throw new \LogicException(sprintf('The given scheme protocol "%s" is not supported by php extension. It must be one of "%s"', $this->config['scheme'], implode('", "', $supportedSchemes)));
}

$this->redis = new \Redis();

$connectionMethod = $this->config['persistent'] ? 'pconnect' : 'connect';

$host = $this->config['scheme'] === 'rediss' ? 'tls://' . $this->config['host'] : $this->config['host'];
$host = 'rediss' === $this->config['scheme'] ? 'tls://' . $this->config['host'] : $this->config['host'];

$result = call_user_func(
[$this->redis, $connectionMethod],
Expand Down

0 comments on commit bfc1d65

Please sign in to comment.