@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $em->expects($this->never())->method('rollback'); |
| 38 | 38 | $em->expects($this->once())->method('persist')->with( |
| 39 | 39 | $this->callback( |
| 40 | - function ($metric) use ($unknownSourceMetric, $createdMetric) { |
|
| 40 | + function($metric) use ($unknownSourceMetric, $createdMetric) { |
|
| 41 | 41 | self::assertNotSame($metric, $unknownSourceMetric); |
| 42 | 42 | self::assertEquals($metric, $createdMetric); |
| 43 | 43 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $metric = $this->createMock(MutableMetricInterface::class); |
| 35 | 35 | |
| 36 | 36 | $em->expects($this->once())->method('transactional')->willReturnCallback( |
| 37 | - function (callable $callback) { |
|
| 37 | + function(callable $callback) { |
|
| 38 | 38 | return $callback(); |
| 39 | 39 | } |
| 40 | 40 | ); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $metric = $this->createMock(MutableMetricInterface::class); |
| 55 | 55 | |
| 56 | 56 | $em->expects($this->once())->method('transactional')->willReturnCallback( |
| 57 | - function (callable $callback) { |
|
| 57 | + function(callable $callback) { |
|
| 58 | 58 | return $callback(); |
| 59 | 59 | } |
| 60 | 60 | ); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | $samples = array_combine($files, $files); |
| 19 | 19 | $samples = array_map( |
| 20 | - function (string $fname) { |
|
| 20 | + function(string $fname) { |
|
| 21 | 21 | return [$fname]; |
| 22 | 22 | }, |
| 23 | 23 | $samples |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | implode( |
| 71 | 71 | "\n\n", |
| 72 | 72 | array_map( |
| 73 | - function ($l) { |
|
| 73 | + function($l) { |
|
| 74 | 74 | return implode("\n\n", $l); |
| 75 | 75 | }, |
| 76 | 76 | $errors |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | public function adjust(float $delta): void |
| 25 | 25 | { |
| 26 | 26 | $this->executeWithLock( |
| 27 | - function () use ($delta) { |
|
| 27 | + function() use ($delta) { |
|
| 28 | 28 | $this->metric->adjust($delta); |
| 29 | 29 | } |
| 30 | 30 | ); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public function setValue(float $value): void |
| 35 | 35 | { |
| 36 | 36 | $this->executeWithLock( |
| 37 | - function () use ($value) { |
|
| 37 | + function() use ($value) { |
|
| 38 | 38 | $this->metric->setValue($value); |
| 39 | 39 | } |
| 40 | 40 | ); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | private function executeWithLock(callable $fn): void |
| 62 | 62 | { |
| 63 | 63 | $this->manager->transactional( |
| 64 | - function () use ($fn) { |
|
| 64 | + function() use ($fn) { |
|
| 65 | 65 | $this->manager->lock($this->metric, LockMode::PESSIMISTIC_WRITE); |
| 66 | 66 | |
| 67 | 67 | $this->manager->refresh($this->metric); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | ); |
| 89 | 89 | $responseFactory->canBeDisabled(); |
| 90 | 90 | $responseFactory->beforeNormalization()->ifString()->then( |
| 91 | - function (string $v) { |
|
| 91 | + function(string $v) { |
|
| 92 | 92 | return ['type' => 'service', 'id' => $v]; |
| 93 | 93 | } |
| 94 | 94 | ); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | 'Collectors also can be configured as services via `' . DefinitionFactory\Collector::TAG . '` tag with `' . DefinitionFactory\Collector::ALIAS_ATTRIBUTE . '` attribute' |
| 112 | 112 | ); |
| 113 | 113 | $collector->beforeNormalization()->ifString()->then( |
| 114 | - function (string $v) { |
|
| 114 | + function(string $v) { |
|
| 115 | 115 | return ['type' => Collector::COLLECTOR_TYPE_SERVICE, 'id' => $v]; |
| 116 | 116 | } |
| 117 | 117 | ); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | 'Storages also can be configured as services via `' . DefinitionFactory\Storage::TAG . '` tag with `' . DefinitionFactory\Storage::ALIAS_ATTRIBUTE . '` attribute' |
| 158 | 158 | ); |
| 159 | 159 | $storage->beforeNormalization()->ifString()->then( |
| 160 | - function (string $v) { |
|
| 160 | + function(string $v) { |
|
| 161 | 161 | return ['type' => 'service', 'id' => $v]; |
| 162 | 162 | } |
| 163 | 163 | ); |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | private function formatTags(array $tags): string |
| 62 | 62 | { |
| 63 | 63 | $parts = array_map( |
| 64 | - function (string $val, string $key) { |
|
| 64 | + function(string $val, string $key) { |
|
| 65 | 65 | return "$key:$val"; |
| 66 | 66 | }, |
| 67 | 67 | array_values($tags), |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $collector->expects($this->once())->method('collect')->willReturn($source); |
| 38 | 38 | $storage->expects($this->once())->method('receive')->with( |
| 39 | 39 | $this->callback( |
| 40 | - function (MetricSourceInterface $metricSource) use ($m1, $m2) { |
|
| 40 | + function(MetricSourceInterface $metricSource) use ($m1, $m2) { |
|
| 41 | 41 | $actual = []; |
| 42 | 42 | foreach ($metricSource->getMetrics() as $metric) { |
| 43 | 43 | $actual[$metric->getName()] = ['value' => $metric->resolve(), 'tags' => $metric->getTags()]; |