DataProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBooks() 0 12 1
A getAuthors() 0 4 1
1
<?php
2
/**
3
 * This file is a part of GraphQL project.
4
 *
5
 * @author Alexandr Viniychuk <[email protected]>
6
 * created: 4/23/17 11:10 PM
7
 */
8
9
namespace Examples\BookStore;
10
11
12
class DataProvider
13
{
14
15
    static private $authors = [
16
        '1' => [
17
            'id' => '1',
18
            'firstName' => 'Mark',
19
            'lastName' => 'Twain'
20
        ]
21
    ];
22
23
    public static function getBooks()
24
    {
25
        return [
26
            [
27
                'id' => 1,
28
                'title' => 'The Adventures of Tom Sawyer',
29
                'year' => 1876,
30
                'isbn' => '978-0996584838',
31
                'author' => self::$authors['1']
32
            ],
33
        ];
34
    }
35
36
    public static function getAuthors()
37
    {
38
        return self::$authors;
39
    }
40
}