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

Commit

Permalink
fixed incorrect return-type in data-profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Utama authored and nutama committed Sep 23, 2019
1 parent 2aebd38 commit ff3feb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Component/Profiler/WebpackDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public function reset()
/**
* @param string $id
* @param mixed $default
* @return string
* @return null|string
*/
public function get($id, $default = false): string
public function get($id, $default = false): ?string
{
return $this->profiler->get($id, $default);
}
Expand Down
7 changes: 5 additions & 2 deletions test/Component/Profiler/WebpackDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ public function testProfiler(): void
{
$profiler = new Profiler();
$collector = new WebpackDataCollector($profiler);
$profiler->set('foobar', 'hoi');
$collector->collect(
$this->getMockBuilder(Request::class)->getMock(),
$this->getMockBuilder(Response::class)->getMock()
);

self::assertEquals('hoi', $collector->get('foobar'));
self::assertEquals('webpack', $collector->getName());
self::assertNull($collector->get('foobar'));

$profiler->set('foobar', 'hoi');

self::assertEquals('hoi', $collector->get('foobar'));
}
}

0 comments on commit ff3feb8

Please sign in to comment.