1313namespace Bazinga \GeocoderBundle \DataCollector ;
1414
1515use Bazinga \GeocoderBundle \Plugin \ProfilingPlugin ;
16+ use Geocoder \Collection ;
17+ use Geocoder \Query \Query ;
1618use Symfony \Component \HttpFoundation \Request ;
1719use Symfony \Component \HttpFoundation \Response ;
1820use Symfony \Component \HttpKernel \DataCollector \DataCollector ;
@@ -34,7 +36,7 @@ public function __construct()
3436 }
3537
3638 /**
37- * {@inheritdoc}
39+ * @return void
3840 */
3941 public function reset ()
4042 {
@@ -45,6 +47,8 @@ public function reset()
4547
4648 /**
4749 * {@inheritdoc}
50+ *
51+ * @return void
4852 */
4953 public function collect (Request $ request , Response $ response , \Throwable $ exception = null )
5054 {
@@ -53,7 +57,6 @@ public function collect(Request $request, Response $response, \Throwable $except
5357 return ;
5458 }
5559
56- /** @var ProfilingPlugin[] $instances */
5760 $ instances = $ this ->instances ;
5861
5962 foreach ($ instances as $ instance ) {
@@ -67,6 +70,8 @@ public function collect(Request $request, Response $response, \Throwable $except
6770
6871 /**
6972 * Returns an array of collected requests.
73+ *
74+ * @phpstan-return array<int, array{query: Query, queryString: string, duration: float, providerName: string, result: mixed, resultCount: int}>
7075 */
7176 public function getQueries (): array
7277 {
@@ -86,18 +91,27 @@ public function getTotalDuration(): float
8691 return $ time ;
8792 }
8893
94+ /**
95+ * @return string[]
96+ */
8997 public function getProviders (): array
9098 {
9199 return $ this ->data ['providers ' ];
92100 }
93101
102+ /**
103+ * @phpstan-return array<int, array{query: Query, queryString: string, duration: float, providerName: string, result: mixed, resultCount: int}>
104+ */
94105 public function getProviderQueries (string $ provider ): array
95106 {
96- return array_filter ($ this ->data ['queries ' ], function ($ data ) use ($ provider ) {
107+ return array_filter ($ this ->data ['queries ' ], static function ($ data ) use ($ provider ) {
97108 return $ data ['providerName ' ] === $ provider ;
98109 });
99110 }
100111
112+ /**
113+ * @return void
114+ */
101115 public function addInstance (ProfilingPlugin $ instance )
102116 {
103117 $ this ->instances [] = $ instance ;
0 commit comments