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

ExploreLocations   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 17
dl 0
loc 23
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 21 1
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
}