Skip to content
This repository was archived by the owner on Dec 22, 2025. It is now read-only.

Commit ca5acde

Browse files
committed
Fixed code style
1 parent 583334a commit ca5acde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+51
-122
lines changed

src/Bucket.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
namespace HelloFresh\Stats;
43

54
/**

src/Bucket/HTTPRequest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Bucket;
43

5-
64
use HelloFresh\Stats\HTTPMetricAlterCallback;
75
use Psr\Http\Message\RequestInterface;
86

src/Bucket/MetricOperation.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Bucket;
43

5-
64
use HelloFresh\Stats\Bucket;
75

86
class MetricOperation extends \SplFixedArray
@@ -43,6 +41,7 @@ protected function valueToString($value)
4341
}
4442

4543
$str = (string)$value;
44+
4645
return empty($str) ? Bucket::METRIC_EMPTY_PLACEHOLDER : $str;
4746
}
4847
}

src/Bucket/Plain.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Bucket;
43

5-
64
use Behat\Transliterator\Transliterator;
75
use HelloFresh\Stats\Bucket;
86

@@ -20,9 +18,9 @@ class Plain implements Bucket
2018
/**
2119
* Plain constructor.
2220
*
23-
* @param string $section
21+
* @param string $section
2422
* @param MetricOperation $operation
25-
* @param bool $success
23+
* @param bool $success
2624
*/
2725
public function __construct($section, MetricOperation $operation, $success)
2826
{

src/Client.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats;
43

5-
64
use HelloFresh\Stats\Bucket\MetricOperation;
75
use Psr\Http\Message\RequestInterface;
86

@@ -19,8 +17,8 @@ public function buildTimer();
1917
* Tracks HTTP Request stats.
2018
*
2119
* @param RequestInterface $request
22-
* @param Timer $timer
23-
* @param bool $success
20+
* @param Timer $timer
21+
* @param bool $success
2422
*
2523
* @return self
2624
*/
@@ -29,11 +27,11 @@ public function trackRequest(RequestInterface $request, Timer $timer, $success);
2927
/**
3028
* Tracks custom operation with n diff.
3129
*
32-
* @param string $section
30+
* @param string $section
3331
* @param MetricOperation $operation
34-
* @param bool $success
35-
* @param Timer|null $timer
36-
* @param int $n
32+
* @param bool $success
33+
* @param Timer|null $timer
34+
* @param int $n
3735
*
3836
* @return self
3937
*/
@@ -42,10 +40,10 @@ public function trackOperation($section, MetricOperation $operation, $success, T
4240
/**
4341
* Tracks custom metric, w/out ok/fail additional sections.
4442
*
45-
* @param string $section
43+
* @param string $section
4644
* @param MetricOperation $operation
47-
* @param Timer|null $timer
48-
* @param int $n
45+
* @param Timer|null $timer
46+
* @param int $n
4947
*
5048
* @return mixed
5149
*/
@@ -54,9 +52,9 @@ public function trackMetric($section, MetricOperation $operation, Timer $timer =
5452
/**
5553
* Tracks metric absolute value.
5654
*
57-
* @param string $section
55+
* @param string $section
5856
* @param MetricOperation $operation
59-
* @param int $value
57+
* @param int $value
6058
*
6159
* @return self
6260
*/

src/Client/AbstractClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Client;
43

5-
64
use HelloFresh\Stats\Bucket;
75
use HelloFresh\Stats\Bucket\MetricOperation;
86
use HelloFresh\Stats\Client;
@@ -97,6 +95,7 @@ public function trackState($section, MetricOperation $operation, $value)
9795
public function setHTTPMetricAlterCallback(HTTPMetricAlterCallback $callback)
9896
{
9997
$this->httpMetricAlterCallback = $callback;
98+
10099
return $this;
101100
}
102101

@@ -114,6 +113,7 @@ public function getHTTPMetricAlterCallback()
114113
public function setHTTPRequestSection($section)
115114
{
116115
$this->httpRequestSection = $section;
116+
117117
return $this;
118118
}
119119

src/Client/Log.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Client;
43

5-
64
use HelloFresh\Stats\Client;
75
use HelloFresh\Stats\Incrementer;
86
use HelloFresh\Stats\State;
@@ -46,6 +44,7 @@ protected function getIncrementer()
4644
if (null === $this->incrementer) {
4745
$this->incrementer = new Incrementer\Log($this->logger);
4846
}
47+
4948
return $this->incrementer;
5049
}
5150

@@ -57,6 +56,7 @@ protected function getState()
5756
if (null === $this->state) {
5857
$this->state = new State\Log($this->logger);
5958
}
59+
6060
return $this->state;
6161
}
6262
}

src/Client/Memory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Client;
43

5-
64
use HelloFresh\Stats\Client;
75
use HelloFresh\Stats\Incrementer;
86
use HelloFresh\Stats\State;
@@ -33,6 +31,7 @@ protected function getIncrementer()
3331
if (null === $this->incrementer) {
3432
$this->incrementer = new Incrementer\Memory();
3533
}
34+
3635
return $this->incrementer;
3736
}
3837

@@ -44,6 +43,7 @@ protected function getState()
4443
if (null === $this->state) {
4544
$this->state = new State\Memory();
4645
}
46+
4747
return $this->state;
4848
}
4949

@@ -54,6 +54,7 @@ public function buildTimer()
5454
{
5555
$timer = new Timer\Memory();
5656
$this->timers[] = $timer;
57+
5758
return $timer;
5859
}
5960

src/Client/NoOp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Client;
43

5-
64
use HelloFresh\Stats\Client;
75
use HelloFresh\Stats\Incrementer;
86
use HelloFresh\Stats\State;
@@ -39,6 +37,7 @@ protected function getIncrementer()
3937
if (null === $this->incrementer) {
4038
$this->incrementer = new Incrementer\NoOp();
4139
}
40+
4241
return $this->incrementer;
4342
}
4443

@@ -50,6 +49,7 @@ protected function getState()
5049
if (null === $this->state) {
5150
$this->state = new State\NoOp();
5251
}
52+
5353
return $this->state;
5454
}
5555
}

src/Client/StatsD.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace HelloFresh\Stats\Client;
43

5-
64
use HelloFresh\Stats\Client;
75
use HelloFresh\Stats\HTTPMetricAlterCallback;
86
use HelloFresh\Stats\Incrementer;
@@ -46,6 +44,7 @@ protected function buildOptions($dsn)
4644
$url = (array)parse_url($dsn);
4745

4846
parse_str(empty($url['query']) ? '' : $url['query'], $params);
47+
4948
return [
5049
'host' => empty($url['host']) ? 'localhost' : $url['host'],
5150
'port' => empty($url['port']) ? 8125 : $url['port'],
@@ -71,6 +70,7 @@ protected function getIncrementer()
7170
if (null === $this->incrementer) {
7271
$this->incrementer = new Incrementer\StatsD($this->client);
7372
}
73+
7474
return $this->incrementer;
7575
}
7676

@@ -82,6 +82,7 @@ protected function getState()
8282
if (null === $this->state) {
8383
$this->state = new State\StatsD($this->client);
8484
}
85+
8586
return $this->state;
8687
}
8788
}

0 commit comments

Comments
 (0)