Passed
Push — master ( b14536...d7fcc2 )
by Paweł
03:55
created

ExploreLocations::map()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 21
c 0
b 0
f 0
rs 9.7333
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created for IG Client.
4
 * User: jakim <[email protected]>
5
 * Date: 16.03.2018
6
 */
7
8
namespace Jakim\Mapper;
9
10
11
use Jakim\Helper\ArrayHelper;
12
use Jakim\Model\Location;
13
use Jakim\Model\Post;
14
use Jakim\Model\Tag;
15
16
class ExploreLocations extends AccountDetails
17
{
18
    protected function map(): array
19
    {
20
        $class = Post::class;
21
        $postMap = ArrayHelper::getValue(parent::map(), "$class.item");
22
23
        return [
24
            Location::class => [
25
                'envelope' => 'graphql.location',
26
                'item' => [
27
                    'id' => 'id',
28
                    'name' => 'name',
29
                    'slug' => 'slug',
30
                    'hasPublicPage' => 'has_public_page',
31
                    'lat' => 'lat',
32
                    'lng' => 'lng',
33
                    'media' => 'edge_location_to_media.count',
34
                ],
35
            ],
36
            Post::class => [
37
                'envelope' => 'graphql.location.edge_location_to_top_posts.edges',
38
                'item' => $postMap,
39
            ],
40
        ];
41
    }
42
}