DataProvider::getBooks()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}