Factory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 19
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A newStopwatchFetcher() 0 7 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace FileFetcher\Stopwatch;
6
7
use FileFetcher\FileFetcher;
8
use FileFetcher\Stopwatch\PackagePrivate\StopwatchFileFetcher;
9
use Symfony\Component\Stopwatch\Stopwatch;
10
11
/**
12
 * Public interface of jeroen/file-fetcher-stopwatch.
13
 *
14
 * @licence BSD-3-Clause
15
 * @author Jeroen De Dauw < [email protected] >
16
 */
17
class Factory {
18
19
	public const STOPWATCH_CATEGORY = 'file_fetcher';
20
21
	/**
22
	 * Decorator for FileFetcher objects that profiles file fetching calls using Symfony Stopwatch.
23
	 *
24
	 * https://packagist.org/packages/symfony/stopwatch
25
	 * https://symfony.com/doc/current/components/stopwatch.html
26
	 */
27 1
	public function newStopwatchFetcher( FileFetcher $fileFetcher, Stopwatch $stopwatch, string $category = self::STOPWATCH_CATEGORY ): FileFetcher {
28 1
		return new StopwatchFileFetcher(
29 1
			$fileFetcher,
30
			$stopwatch,
31
			$category
32
		);
33
	}
34
35
}
36