Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Merge 8503a48 into 3147506
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed May 5, 2019
2 parents 3147506 + 8503a48 commit 46622a3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $rules = [
'@PHP71Migration:risky' => true,
'compact_nullable_typehint' => true,
'void_return' => null,
'static_lambda' => true,
'strict_comparison' => true,
'strict_param' => true,
'php_unit_strict' => true,
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/SonataNotificationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ protected function createAMQPBackend(ContainerBuilder $container, $exchange, $na
*/
private function getQueuesParameters($name, array $queues)
{
$params = array_unique(array_map(function ($q) use ($name) {
$params = array_unique(array_map(static function ($q) use ($name) {
return $q[$name];
}, $queues));

Expand Down
6 changes: 3 additions & 3 deletions tests/Backend/PostponeRuntimeBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function testLiveEnvironment(): void

$phpunit = $this;
$phpunit->passed = false;
$dispatcher->addListener('notification.demo', function (ConsumerEventInterface $event) use ($phpunit, $message): void {
$dispatcher->addListener('notification.demo', static function (ConsumerEventInterface $event) use ($phpunit, $message): void {
$phpunit->assertSame($message, $event->getMessage());

$phpunit->passed = true;
Expand All @@ -111,15 +111,15 @@ public function testRecursiveMessage(): void
$phpunit->passed1 = false;
$phpunit->passed2 = false;

$dispatcher->addListener('notification.demo1', function (ConsumerEventInterface $event) use ($phpunit, $message1, $message2, $backend, $dispatcher): void {
$dispatcher->addListener('notification.demo1', static function (ConsumerEventInterface $event) use ($phpunit, $message1, $message2, $backend, $dispatcher): void {
$phpunit->assertSame($message1, $event->getMessage());

$phpunit->passed1 = true;

$backend->publish($message2);
});

$dispatcher->addListener('notification.demo2', function (ConsumerEventInterface $event) use ($phpunit, $message2): void {
$dispatcher->addListener('notification.demo2', static function (ConsumerEventInterface $event) use ($phpunit, $message2): void {
$phpunit->assertSame($message2, $event->getMessage());

$phpunit->passed2 = true;
Expand Down
12 changes: 6 additions & 6 deletions tests/Entity/MessageManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testGetPager(): void
{
$self = $this;
$this
->getMessageManager(function ($qb) use ($self): void {
->getMessageManager(static function ($qb) use ($self): void {
$qb->expects($self->once())->method('getRootAliases')->will($self->returnValue(['m']));
$qb->expects($self->never())->method('andWhere');
$qb->expects($self->once())->method('setParameters')->with([]);
Expand All @@ -78,7 +78,7 @@ public function testGetPagerWithInvalidSort(): void

$self = $this;
$this
->getMessageManager(function ($qb) use ($self): void {
->getMessageManager(static function ($qb) use ($self): void {
})
->getPager([], 1, 10, ['invalid' => 'ASC']);
}
Expand All @@ -87,7 +87,7 @@ public function testGetPagerWithMultipleSort(): void
{
$self = $this;
$this
->getMessageManager(function ($qb) use ($self): void {
->getMessageManager(static function ($qb) use ($self): void {
$qb->expects($self->once())->method('getRootAliases')->will($self->returnValue(['m']));
$qb->expects($self->never())->method('andWhere');
$qb->expects($self->once())->method('setParameters')->with([]);
Expand All @@ -113,7 +113,7 @@ public function testGetPagerWithOpenedMessages(): void
{
$self = $this;
$this
->getMessageManager(function ($qb) use ($self): void {
->getMessageManager(static function ($qb) use ($self): void {
$qb->expects($self->once())->method('getRootAliases')->will($self->returnValue(['m']));
$qb->expects($self->once())->method('andWhere')->with($self->equalTo('m.state = :state'));
$qb->expects($self->once())->method('setParameters')->with($self->equalTo([
Expand All @@ -127,7 +127,7 @@ public function testGetPagerWithCanceledMessages(): void
{
$self = $this;
$this
->getMessageManager(function ($qb) use ($self): void {
->getMessageManager(static function ($qb) use ($self): void {
$qb->expects($self->once())->method('getRootAliases')->will($self->returnValue(['m']));
$qb->expects($self->once())->method('andWhere')->with($self->equalTo('m.state = :state'));
$qb->expects($self->once())->method('setParameters')->with($self->equalTo([
Expand All @@ -141,7 +141,7 @@ public function testGetPagerWithInProgressMessages(): void
{
$self = $this;
$this
->getMessageManager(function ($qb) use ($self): void {
->getMessageManager(static function ($qb) use ($self): void {
$qb->expects($self->once())->method('getRootAliases')->will($self->returnValue(['m']));
$qb->expects($self->once())->method('andWhere')->with($self->equalTo('m.state = :state'));
$qb->expects($self->once())->method('setParameters')->with($self->equalTo([
Expand Down

0 comments on commit 46622a3

Please sign in to comment.