Skip to content

Fix Code Style in all files #889

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

Merged
merged 1 commit into from
Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/amqp-lib/Tests/AmqpProducerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function testShouldPublishMessageToTopic()
->expects($this->once())
->method('basic_publish')
->with($this->isInstanceOf(LibAMQPMessage::class), 'topic', 'routing-key')
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
$amqpMessage = $message;
}))
})
;

$topic = new AmqpTopic('topic');
Expand All @@ -86,9 +86,9 @@ public function testShouldPublishMessageToQueue()
->expects($this->once())
->method('basic_publish')
->with($this->isInstanceOf(LibAMQPMessage::class), $this->isEmpty(), 'queue')
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
$amqpMessage = $message;
}))
})
;

$queue = new AmqpQueue('queue');
Expand All @@ -107,9 +107,9 @@ public function testShouldSetMessageHeaders()
$channel
->expects($this->once())
->method('basic_publish')
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
$amqpMessage = $message;
}))
})
;

$producer = new AmqpProducer($channel, $this->createContextMock());
Expand All @@ -126,9 +126,9 @@ public function testShouldSetMessageProperties()
$channel
->expects($this->once())
->method('basic_publish')
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
$amqpMessage = $message;
}))
})
;

$producer = new AmqpProducer($channel, $this->createContextMock());
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbal/DbalConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class DbalConsumer implements Consumer
{
use ConsumerPollingTrait,
DbalConsumerHelperTrait;
use ConsumerPollingTrait;
use DbalConsumerHelperTrait;

/**
* @var DbalContext
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbal/DbalMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DbalMessage implements Message
private $timeToLive;

/**
* @var null|string
* @var string|null
*/
private $deliveryId;

Expand Down
10 changes: 5 additions & 5 deletions pkg/dbal/Tests/DbalConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ public function testShouldDeleteMessageOnAcknowledge()
$context
->expects($this->once())
->method('getDbalConnection')
->will($this->returnValue($dbal))
->willReturn($dbal)
;
$context
->expects($this->once())
->method('getTableName')
->will($this->returnValue('some-table-name'))
->willReturn('some-table-name')
;

$consumer = new DbalConsumer($context, $queue);
Expand Down Expand Up @@ -150,12 +150,12 @@ public function testShouldDeleteMessageFromQueueOnReject()
$context
->expects($this->once())
->method('getDbalConnection')
->will($this->returnValue($dbal))
->willReturn($dbal)
;
$context
->expects($this->once())
->method('getTableName')
->will($this->returnValue('some-table-name'))
->willReturn('some-table-name')
;

$consumer = new DbalConsumer($context, $queue);
Expand All @@ -182,7 +182,7 @@ public function testRejectShouldReSendMessageToSameQueueOnRequeue()
$context
->expects($this->once())
->method('createProducer')
->will($this->returnValue($producerMock))
->willReturn($producerMock)
;

$consumer = new DbalConsumer($context, $queue);
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbal/Tests/DbalSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private function createDbalContextMock()
}

/**
* @param null|mixed $queueName
* @param mixed|null $queueName
*
* @return Consumer|\PHPUnit_Framework_MockObject_MockObject
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testShouldClearIdentityMap()
$registry
->expects($this->once())
->method('getManagers')
->will($this->returnValue(['manager-name' => $manager]))
->willReturn(['manager-name' => $manager])
;

$context = $this->createContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public function testShouldNotReconnectIfConnectionIsOK()
$connection
->expects($this->once())
->method('isConnected')
->will($this->returnValue(true))
->willReturn(true)
;
$connection
->expects($this->once())
->method('ping')
->will($this->returnValue(true))
->willReturn(true)
;
$connection
->expects($this->never())
Expand All @@ -52,7 +52,7 @@ public function testShouldNotReconnectIfConnectionIsOK()
$registry
->expects($this->once())
->method('getConnections')
->will($this->returnValue([$connection]))
->willReturn([$connection])
;

$extension = new DoctrinePingConnectionExtension($registry);
Expand All @@ -65,12 +65,12 @@ public function testShouldDoesReconnectIfConnectionFailed()
$connection
->expects($this->once())
->method('isConnected')
->will($this->returnValue(true))
->willReturn(true)
;
$connection
->expects($this->once())
->method('ping')
->will($this->returnValue(false))
->willReturn(false)
;
$connection
->expects($this->once())
Expand All @@ -97,7 +97,7 @@ public function testShouldDoesReconnectIfConnectionFailed()
$registry
->expects($this->once())
->method('getConnections')
->will($this->returnValue([$connection]))
->willReturn([$connection])
;

$extension = new DoctrinePingConnectionExtension($registry);
Expand All @@ -110,7 +110,7 @@ public function testShouldSkipIfConnectionWasNotOpened()
$connection1
->expects($this->once())
->method('isConnected')
->will($this->returnValue(false))
->willReturn(false)
;
$connection1
->expects($this->never())
Expand All @@ -122,12 +122,12 @@ public function testShouldSkipIfConnectionWasNotOpened()
$connection2
->expects($this->once())
->method('isConnected')
->will($this->returnValue(true))
->willReturn(true)
;
$connection2
->expects($this->once())
->method('ping')
->will($this->returnValue(true))
->willReturn(true)
;

$context = $this->createContext();
Expand All @@ -140,7 +140,7 @@ public function testShouldSkipIfConnectionWasNotOpened()
$registry
->expects($this->once())
->method('getConnections')
->will($this->returnValue([$connection1, $connection2]))
->willReturn([$connection1, $connection2])
;

$extension = new DoctrinePingConnectionExtension($registry);
Expand Down
4 changes: 2 additions & 2 deletions pkg/enqueue/Client/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ public function __construct($body = '', array $properties = [], array $headers =
}

/**
* @return null|string
* @return string|null
*/
public function getBody()
{
return $this->body;
}

/**
* @param null|string|int|float|array|\JsonSerializable $body
* @param string|int|float|array|\JsonSerializable|null $body
*/
public function setBody($body)
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue/Consumption/Context/MessageResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getReceivedAt(): int
}

/**
* @return Result|null|object|string
* @return Result|object|string|null
*/
public function getResult()
{
Expand Down
4 changes: 2 additions & 2 deletions pkg/enqueue/Tests/Client/DelegateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public function testShouldProcessMessage()
->expects($this->once())
->method('process')
->with($this->identicalTo($message), $this->identicalTo($session))
->will($this->returnValue('return-value'))
->willReturn('return-value')
;

$processorRegistry = $this->createProcessorRegistryMock();
$processorRegistry
->expects($this->once())
->method('get')
->with('processor-name')
->will($this->returnValue($processor))
->willReturn($processor)
;

$processor = new DelegateProcessor($processorRegistry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testCouldConstructedWithoutAnyArguments()
* @dataProvider provideMessages
*
* @param mixed $body
* @param null|mixed $contentType
* @param mixed|null $contentType
*/
public function testShouldSendStringUnchangedAndAddPlainTextContentTypeIfEmpty(
$body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function testShouldConsumeTillTimeoutIsReached()
}

/**
* @param null|mixed $body
* @param mixed|null $body
*
* @return InteropMessage|\PHPUnit_Framework_MockObject_MockObject
*/
Expand All @@ -244,7 +244,7 @@ private function createMessageStub($body = null)
}

/**
* @param null|mixed $queueName
* @param mixed|null $queueName
*
* @return Consumer|\PHPUnit_Framework_MockObject_MockObject
*/
Expand Down
6 changes: 3 additions & 3 deletions pkg/job-queue/Tests/CalculateRootJobStatusProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testShouldCallCalculateJobRootStatusAndACKMessage()
->expects($this->once())
->method('findJobById')
->with('12345')
->will($this->returnValue($job))
->willReturn($job)
;

$logger = $this->createLoggerMock();
Expand Down Expand Up @@ -146,7 +146,7 @@ public function testShouldSendRootJobStoppedMessageIfJobHasStopped()
->expects($this->once())
->method('findJobById')
->with('12345')
->will($this->returnValue($job))
->willReturn($job)
;

$logger = $this->createLoggerMock();
Expand All @@ -156,7 +156,7 @@ public function testShouldSendRootJobStoppedMessageIfJobHasStopped()
->expects($this->once())
->method('calculate')
->with($this->identicalTo($job))
->will($this->returnValue(true))
->willReturn(true)
;

$producer = $this->createProducerMock();
Expand Down
Loading