Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 19 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 32 | public static function extractApp(array $data, string $locale, string $country): App |
|
34 | { |
||
35 | 32 | $name = $data[2]; |
|
36 | 32 | $appId = $data[12][0]; |
|
37 | 32 | $icon = new GoogleImage($data[1][1][0][3][2]); |
|
38 | 32 | $developer = self::extractDeveloper($data); |
|
39 | 32 | $price = $data[7][0][3][2][1][0][2] ?? null; |
|
40 | 32 | $summary = self::extractSummary($data); |
|
41 | 32 | $score = $data[6][0][2][1][1] ?? 0.0; |
|
42 | |||
43 | 32 | return App::newBuilder() |
|
44 | 32 | ->setId($appId) |
|
45 | 32 | ->setLocale($locale) |
|
46 | 32 | ->setCountry($country) |
|
47 | 32 | ->setName($name) |
|
48 | 32 | ->setSummary($summary) |
|
49 | 32 | ->setDeveloper($developer) |
|
50 | 32 | ->setIcon($icon) |
|
51 | 32 | ->setScore($score) |
|
52 | 32 | ->setPriceText($price) |
|
53 | 32 | ->build() |
|
54 | ; |
||
88 |