77use HelloFresh \Stats \HTTPMetricAlterCallback ;
88use HelloFresh \Stats \Incrementer ;
99use HelloFresh \Stats \State ;
10- use HelloFresh \Stats \Timer \ StatsD as StatsDTimer ;
10+ use HelloFresh \Stats \Timer ;
1111use League \StatsD \Client as StatsDClient ;
1212
1313class StatsD extends AbstractClient implements Client
@@ -33,6 +33,7 @@ public function __construct($dsn)
3333 {
3434 $ this ->client = new StatsDClient ();
3535 $ this ->configure ($ dsn );
36+ $ this ->resetHTTPRequestSection ();
3637 }
3738
3839 /**
@@ -42,13 +43,13 @@ protected function configure($dsn)
4243 {
4344 $ url = (array )parse_url ($ dsn );
4445
45- $ params = parse_str (empty ($ url ['query ' ]) ? '' : $ url ['query ' ]);
46+ parse_str (empty ($ url ['query ' ]) ? '' : $ url ['query ' ], $ params );
4647 $ options = [
47- 'host ' => empty ($ url ['host ' ]) ? 'localhost ' : '' ,
48- 'port ' => empty ($ url ['port ' ]) ? $ url ['port ' ] : 8125 ,
48+ 'host ' => empty ($ url ['host ' ]) ? 'localhost ' : $ url [ ' host ' ] ,
49+ 'port ' => empty ($ url ['port ' ]) ? 8125 : $ url ['port ' ],
4950 'namespace ' => empty ($ url ['path ' ]) ? '' : trim ($ url ['path ' ], '/ ' ),
5051 'timeout ' => empty ($ params ['timeout ' ]) ? null : (float )$ params ['timeout ' ],
51- 'throwConnectionExceptions ' => empty ($ params ['error ' ]) ? true : (bool )$ params ['error ' ],
52+ 'throwConnectionExceptions ' => isset ($ params ['error ' ]) ? (bool )$ params ['error ' ] : true ,
5253 ];
5354
5455 $ this ->client ->configure ($ options );
@@ -59,7 +60,7 @@ protected function configure($dsn)
5960 */
6061 public function buildTimer ()
6162 {
62- return new StatsDTimer ($ this ->client );
63+ return new Timer \ StatsD ($ this ->client );
6364 }
6465
6566 /**
0 commit comments