Passed
Push — main ( 910f4b...bcdb57 )
by Will
02:58
created

frameworks   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 19
ccs 12
cts 12
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 12 1
1
<?php
2
declare(strict_types = 1);
3
namespace hexydec\agentzero;
4
5
class frameworks {
6
7
	/**
8
	 * Generates a configuration array for matching app frameworks
9
	 * 
10
	 * @return array<string,props> An array with keys representing the string to match, and values a props object defining how to generate the match and which properties to set
11
	 */
12 5
	public static function get() : array {
13 1
		return [
14 1
			'Electron/' => new props('start', fn (string $value) : array => [
15 5
				'framework' => 'Electron',
16 5
				'frameworkversion' => \explode('/', $value, 3)[1]
17 5
			]),
18 1
			'MAUI' => new props('start', [
19 1
				'framework' => 'MAUI'
20 1
			]),
21 1
			'Cordova' => new props('start', fn (string $value) : array => [
22 2
				'framework' => 'Cordova',
23 2
				'frameworkversion' => \explode('/', $value, 3)[1]
24 2
			])
25 1
		];
26
	}
27
}