Skip to content

Commit

Permalink
update coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jul 7, 2017
1 parent bc002f4 commit 3e76e68
Show file tree
Hide file tree
Showing 36 changed files with 214 additions and 214 deletions.
8 changes: 4 additions & 4 deletions src/AbstractConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function consume(int $msgAmount = 0)
* @param Queue $queue
* @return DeliveryResult
*/
protected function handleDelivery(Envelope $envelope, Queue $queue) : DeliveryResult
protected function handleDelivery(Envelope $envelope, Queue $queue): DeliveryResult
{
$this->logger->debug('Handling delivery of message', $this->extractMessageInformation($envelope));

Expand Down Expand Up @@ -242,7 +242,7 @@ protected function handleException(\Throwable $e)
*
* @return FlushDeferredResult
*/
protected function flushDeferred() : FlushDeferredResult
protected function flushDeferred(): FlushDeferredResult
{
$callback = $this->flushCallback;

Expand Down Expand Up @@ -375,7 +375,7 @@ protected function ackOrNackBlock()
* @param Envelope $envelope
* @return DeliveryResult
*/
protected function handleInternalMessage(Envelope $envelope) : DeliveryResult
protected function handleInternalMessage(Envelope $envelope): DeliveryResult
{
if ('shutdown' === $envelope->getType()) {
$this->logger->info('Shutdown message received');
Expand Down Expand Up @@ -420,7 +420,7 @@ protected function handleInternalMessage(Envelope $envelope) : DeliveryResult
* @param Envelope $envelope
* @return array
*/
protected function extractMessageInformation(Envelope $envelope) : array
protected function extractMessageInformation(Envelope $envelope): array
{
return [
'body' => $envelope->getBody(),
Expand Down
6 changes: 3 additions & 3 deletions src/CallbackConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ final class CallbackConsumer extends AbstractConsumer
*
* Callback functions with all arguments have the following signature:
*
* function deliveryCallback(Envelope $envelope, Queue $queue) : DeliveryResult;
* function flushCallback(Queue $queue) : FlushDeferredResult;
* function errorCallback(\Throwable $e, AbstractConsumer $consumer) : void;
* function deliveryCallback(Envelope $envelope, Queue $queue): DeliveryResult;
* function flushCallback(Queue $queue): FlushDeferredResult;
* function errorCallback(\Throwable $e, AbstractConsumer $consumer): void;
*/
public function __construct(
Queue $queue,
Expand Down
20 changes: 10 additions & 10 deletions src/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public function getResource();
*
* @return bool Indicates whether the channel is connected.
*/
public function isConnected() : bool;
public function isConnected(): bool;

/**
* Return internal channel ID
*
* @return int
*/
public function getChannelId() : int;
public function getChannelId(): int;

/**
* Set the window size to prefetch from the broker.
Expand All @@ -74,7 +74,7 @@ public function setPrefetchSize(int $size);
*
* @return int
*/
public function getPrefetchSize() : int;
public function getPrefetchSize(): int;

/**
* Set the number of messages to prefetch from the broker.
Expand All @@ -94,7 +94,7 @@ public function setPrefetchCount(int $count);
*
* @return int
*/
public function getPrefetchCount() : int;
public function getPrefetchCount(): int;

/**
* Set the Quality Of Service settings for the given channel.
Expand Down Expand Up @@ -149,7 +149,7 @@ public function rollbackTransaction();
*
* @return Connection
*/
public function getConnection() : Connection;
public function getConnection(): Connection;

/**
* Redeliver unacknowledged messages.
Expand All @@ -174,8 +174,8 @@ public function confirmSelect();
*
* Callback functions with all arguments have the following signature:
*
* function ackCallback(int $delivery_tag, bool $multiple) : bool;
* function nackCallback(int $delivery_tag, bool $multiple, bool $requeue) : bool;
* function ackCallback(int $delivery_tag, bool $multiple): bool;
* function nackCallback(int $delivery_tag, bool $multiple, bool $requeue): bool;
*
* and should return boolean false when wait loop should be canceled.
*
Expand Down Expand Up @@ -211,7 +211,7 @@ public function waitForConfirm(float $timeout = 0.0);
* string $exchange,
* string $routingKey,
* Envelope $envelope,
* string $body) : bool;
* string $body): bool;
*
* and should return boolean false when wait loop should be canceled.
*
Expand All @@ -231,10 +231,10 @@ public function waitForBasicReturn(float $timeout = 0.0);
/**
* @return Exchange
*/
public function newExchange() : Exchange;
public function newExchange(): Exchange;

/**
* @return Queue
*/
public function newQueue() : Queue;
public function newQueue(): Queue;
}
8 changes: 4 additions & 4 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface Connection
*
* @return bool True if connected, false otherwise.
*/
public function isConnected() : bool;
public function isConnected(): bool;

/**
* Establish a transient connection with the AMQP broker.
Expand All @@ -62,12 +62,12 @@ public function disconnect();
*
* @return bool TRUE on success or FALSE on failure.
*/
public function reconnect() : bool;
public function reconnect(): bool;

/**
* @return ConnectionOptions
*/
public function getOptions() : ConnectionOptions;
public function getOptions(): ConnectionOptions;

/**
* @return mixed
Expand All @@ -77,5 +77,5 @@ public function getResource();
/**
* @return Channel
*/
public function newChannel() : Channel;
public function newChannel(): Channel;
}
20 changes: 10 additions & 10 deletions src/ConnectionOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function setHost(string $host)
/**
* @return string
*/
public function getHost() : string
public function getHost(): string
{
return $this->host;
}
Expand All @@ -125,7 +125,7 @@ public function setPassword(string $password)
/**
* @return string
*/
public function getPassword() : string
public function getPassword(): string
{
return $this->password;
}
Expand All @@ -141,7 +141,7 @@ public function setPersistent(bool $persistent)
/**
* @return bool
*/
public function getPersistent() : bool
public function getPersistent(): bool
{
return $this->persistent;
}
Expand All @@ -157,15 +157,15 @@ public function setPort(int $port)
/**
* @return int
*/
public function getPort() : int
public function getPort(): int
{
return $this->port;
}

/**
* @return float
*/
public function getConnectTimeout() : float
public function getConnectTimeout(): float
{
return $this->connectTimeout;
}
Expand All @@ -189,7 +189,7 @@ public function setReadTimeout(float $readTimeout)
/**
* @return float
*/
public function getReadTimeout() : float
public function getReadTimeout(): float
{
return $this->readTimeout;
}
Expand All @@ -205,7 +205,7 @@ public function setLogin(string $login)
/**
* @return string
*/
public function getLogin() : string
public function getLogin(): string
{
return $this->login;
}
Expand All @@ -221,7 +221,7 @@ public function setVhost(string $vhost)
/**
* @return string
*/
public function getVhost() : string
public function getVhost(): string
{
return $this->vhost;
}
Expand All @@ -237,15 +237,15 @@ public function setWriteTimeout(float $writeTimeout)
/**
* @return float
*/
public function getWriteTimeout() : float
public function getWriteTimeout(): float
{
return $this->writeTimeout;
}

/**
* @return int
*/
public function getHeartbeat() : int
public function getHeartbeat(): int
{
return $this->heartbeat;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract class AbstractCommand extends Command
/**
* @return ContainerInterface
*/
public function getContainer() : ContainerInterface
public function getContainer(): ContainerInterface
{
if (null === $this->container) {
$this->container = $this->getHelper('container')->getContainer();
Expand Down
10 changes: 5 additions & 5 deletions src/Container/CallbackConsumerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CallbackConsumerFactory implements ProvidesDefaultOptions, RequiresConfigI
* @return CallbackConsumer
* @throws Exception\InvalidArgumentException
*/
public static function __callStatic(string $name, array $arguments) : CallbackConsumer
public static function __callStatic(string $name, array $arguments): CallbackConsumer
{
if (! isset($arguments[0]) || ! $arguments[0] instanceof ContainerInterface) {
throw new Exception\InvalidArgumentException(
Expand All @@ -86,7 +86,7 @@ public function __construct(string $consumerName)
* @param ContainerInterface $container
* @return CallbackConsumer
*/
public function __invoke(ContainerInterface $container) : CallbackConsumer
public function __invoke(ContainerInterface $container): CallbackConsumer
{
$options = $this->options($container->get('config'), $this->consumerName);

Expand Down Expand Up @@ -131,15 +131,15 @@ public function __invoke(ContainerInterface $container) : CallbackConsumer
/**
* @return array
*/
public function dimensions() : array
public function dimensions(): iterable
{
return ['humus', 'amqp', 'callback_consumer'];
}

/**
* @return array
*/
public function defaultOptions() : array
public function defaultOptions(): iterable
{
return [
'logger' => null,
Expand All @@ -157,7 +157,7 @@ public function defaultOptions() : array
/**
* @return array
*/
public function mandatoryOptions() : array
public function mandatoryOptions(): iterable
{
return [
'queue',
Expand Down
8 changes: 4 additions & 4 deletions src/Container/ConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final class ConnectionFactory implements ProvidesDefaultOptions, RequiresConfigI
* @return Connection
* @throws Exception\InvalidArgumentException
*/
public static function __callStatic(string $name, array $arguments) : Connection
public static function __callStatic(string $name, array $arguments): Connection
{
if (! isset($arguments[0]) || ! $arguments[0] instanceof ContainerInterface) {
throw new Exception\InvalidArgumentException(
Expand All @@ -89,7 +89,7 @@ public function __construct(string $connectionName)
* @param ContainerInterface $container
* @return Connection
*/
public function __invoke(ContainerInterface $container) : Connection
public function __invoke(ContainerInterface $container): Connection
{
if (! $container->has(Driver::class)) {
throw new Exception\RuntimeException('No driver factory registered in container');
Expand Down Expand Up @@ -145,15 +145,15 @@ public function __invoke(ContainerInterface $container) : Connection
/**
* @return array
*/
public function dimensions() : array
public function dimensions(): iterable
{
return ['humus', 'amqp', 'connection'];
}

/**
* @return array
*/
public function defaultOptions() : array
public function defaultOptions(): iterable
{
return [
'host' => 'localhost',
Expand Down
6 changes: 3 additions & 3 deletions src/Container/DriverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class DriverFactory implements RequiresConfig, RequiresMandatoryOptions
* @param ContainerInterface $container
* @return Driver
*/
public function __invoke(ContainerInterface $container) : Driver
public function __invoke(ContainerInterface $container): Driver
{
$options = $this->options($container->get('config'));

Expand All @@ -50,15 +50,15 @@ public function __invoke(ContainerInterface $container) : Driver
/**
* @return array
*/
public function dimensions() : array
public function dimensions(): iterable
{
return ['humus', 'amqp'];
}

/**
* @return array
*/
public function mandatoryOptions() : array
public function mandatoryOptions(): iterable
{
return [
'driver'
Expand Down
Loading

0 comments on commit 3e76e68

Please sign in to comment.