Skip to content

Commit 2c6ece8

Browse files
committed
fixed CS
1 parent 1fb3b72 commit 2c6ece8

File tree

9 files changed

+121
-121
lines changed

9 files changed

+121
-121
lines changed

Cache/CacheTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private function doGet(CacheItemPoolInterface $pool, string $key, callable $call
4646

4747
$item = $pool->getItem($key);
4848
$recompute = !$item->isHit() || INF === $beta;
49-
$metadata = $item instanceof ItemInterface ? $item->getMetadata() : array();
49+
$metadata = $item instanceof ItemInterface ? $item->getMetadata() : [];
5050

5151
if (!$recompute && $metadata) {
5252
$expiry = $metadata[ItemInterface::METADATA_EXPIRY] ?? false;

Service/ServiceLocatorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
trait ServiceLocatorTrait
2424
{
2525
private $factories;
26-
private $loading = array();
26+
private $loading = [];
2727

2828
/**
2929
* @param callable[] $factories

Service/ServiceSubscriberTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static function getSubscribedServices(): array
3232
return $services;
3333
}
3434

35-
$services = \is_callable(array('parent', __FUNCTION__)) ? parent::getSubscribedServices() : array();
35+
$services = \is_callable(['parent', __FUNCTION__]) ? parent::getSubscribedServices() : [];
3636

3737
foreach ((new \ReflectionClass(self::class))->getMethods() as $method) {
3838
if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) {
@@ -54,7 +54,7 @@ public function setContainer(ContainerInterface $container)
5454
{
5555
$this->container = $container;
5656

57-
if (\is_callable(array('parent', __FUNCTION__))) {
57+
if (\is_callable(['parent', __FUNCTION__])) {
5858
return parent::setContainer($container);
5959
}
6060
}

Tests/Cache/CacheTraitTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testSave()
3434
->with('computed data');
3535

3636
$cache = $this->getMockBuilder(TestPool::class)
37-
->setMethods(array('getItem', 'save'))
37+
->setMethods(['getItem', 'save'])
3838
->getMock();
3939
$cache->expects($this->once())
4040
->method('getItem')
@@ -60,7 +60,7 @@ public function testNoCallbackCallOnHit()
6060
->method('set');
6161

6262
$cache = $this->getMockBuilder(TestPool::class)
63-
->setMethods(array('getItem', 'save'))
63+
->setMethods(['getItem', 'save'])
6464
->getMock();
6565

6666
$cache->expects($this->once())
@@ -91,7 +91,7 @@ public function testRecomputeOnBetaInf()
9191
->with('computed data');
9292

9393
$cache = $this->getMockBuilder(TestPool::class)
94-
->setMethods(array('getItem', 'save'))
94+
->setMethods(['getItem', 'save'])
9595
->getMock();
9696

9797
$cache->expects($this->once())
@@ -111,7 +111,7 @@ public function testRecomputeOnBetaInf()
111111
public function testExceptionOnNegativeBeta()
112112
{
113113
$cache = $this->getMockBuilder(TestPool::class)
114-
->setMethods(array('getItem', 'save'))
114+
->setMethods(['getItem', 'save'])
115115
->getMock();
116116

117117
$callback = function (CacheItemInterface $item) {
@@ -135,15 +135,15 @@ public function deleteItem($key)
135135
{
136136
}
137137

138-
public function deleteItems(array $keys = array())
138+
public function deleteItems(array $keys = [])
139139
{
140140
}
141141

142142
public function getItem($key)
143143
{
144144
}
145145

146-
public function getItems(array $key = array())
146+
public function getItems(array $key = [])
147147
{
148148
}
149149

Tests/Service/ServiceLocatorTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public function getServiceLocator(array $factories)
2626

2727
public function testHas()
2828
{
29-
$locator = $this->getServiceLocator(array(
29+
$locator = $this->getServiceLocator([
3030
'foo' => function () { return 'bar'; },
3131
'bar' => function () { return 'baz'; },
3232
function () { return 'dummy'; },
33-
));
33+
]);
3434

3535
$this->assertTrue($locator->has('foo'));
3636
$this->assertTrue($locator->has('bar'));
@@ -39,10 +39,10 @@ function () { return 'dummy'; },
3939

4040
public function testGet()
4141
{
42-
$locator = $this->getServiceLocator(array(
42+
$locator = $this->getServiceLocator([
4343
'foo' => function () { return 'bar'; },
4444
'bar' => function () { return 'baz'; },
45-
));
45+
]);
4646

4747
$this->assertSame('bar', $locator->get('foo'));
4848
$this->assertSame('baz', $locator->get('bar'));
@@ -51,13 +51,13 @@ public function testGet()
5151
public function testGetDoesNotMemoize()
5252
{
5353
$i = 0;
54-
$locator = $this->getServiceLocator(array(
54+
$locator = $this->getServiceLocator([
5555
'foo' => function () use (&$i) {
5656
++$i;
5757

5858
return 'bar';
5959
},
60-
));
60+
]);
6161

6262
$this->assertSame('bar', $locator->get('foo'));
6363
$this->assertSame('bar', $locator->get('foo'));
@@ -70,9 +70,9 @@ public function testGetDoesNotMemoize()
7070
*/
7171
public function testThrowsOnUndefinedInternalService()
7272
{
73-
$locator = $this->getServiceLocator(array(
73+
$locator = $this->getServiceLocator([
7474
'foo' => function () use (&$locator) { return $locator->get('bar'); },
75-
));
75+
]);
7676

7777
$locator->get('foo');
7878
}
@@ -83,11 +83,11 @@ public function testThrowsOnUndefinedInternalService()
8383
*/
8484
public function testThrowsOnCircularReference()
8585
{
86-
$locator = $this->getServiceLocator(array(
86+
$locator = $this->getServiceLocator([
8787
'foo' => function () use (&$locator) { return $locator->get('bar'); },
8888
'bar' => function () use (&$locator) { return $locator->get('baz'); },
8989
'baz' => function () use (&$locator) { return $locator->get('bar'); },
90-
));
90+
]);
9191

9292
$locator->get('foo');
9393
}

Tests/Service/ServiceSubscriberTraitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class ServiceSubscriberTraitTest extends TestCase
2121
{
2222
public function testMethodsOnParentsAndChildrenAreIgnoredInGetSubscribedServices()
2323
{
24-
$expected = array(TestService::class.'::aService' => '?Symfony\Contracts\Tests\Service\Service2');
24+
$expected = [TestService::class.'::aService' => '?Symfony\Contracts\Tests\Service\Service2'];
2525

2626
$this->assertEquals($expected, ChildTestService::getSubscribedServices());
2727
}
2828

2929
public function testSetContainerIsCalledOnParent()
3030
{
31-
$container = new class(array()) implements ContainerInterface {
31+
$container = new class([]) implements ContainerInterface {
3232
use ServiceLocatorTrait;
3333
};
3434

0 commit comments

Comments
 (0)