Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit ff3feb8

Browse files
Nathan Utamanutama
Nathan Utama
authored andcommitted
fixed incorrect return-type in data-profiler
1 parent 2aebd38 commit ff3feb8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Component/Profiler/WebpackDataCollector.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public function reset()
4848
/**
4949
* @param string $id
5050
* @param mixed $default
51-
* @return string
51+
* @return null|string
5252
*/
53-
public function get($id, $default = false): string
53+
public function get($id, $default = false): ?string
5454
{
5555
return $this->profiler->get($id, $default);
5656
}

test/Component/Profiler/WebpackDataCollectorTest.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ public function testProfiler(): void
2020
{
2121
$profiler = new Profiler();
2222
$collector = new WebpackDataCollector($profiler);
23-
$profiler->set('foobar', 'hoi');
2423
$collector->collect(
2524
$this->getMockBuilder(Request::class)->getMock(),
2625
$this->getMockBuilder(Response::class)->getMock()
2726
);
2827

29-
self::assertEquals('hoi', $collector->get('foobar'));
3028
self::assertEquals('webpack', $collector->getName());
29+
self::assertNull($collector->get('foobar'));
30+
31+
$profiler->set('foobar', 'hoi');
32+
33+
self::assertEquals('hoi', $collector->get('foobar'));
3134
}
3235
}

0 commit comments

Comments
 (0)