Completed
Pull Request — master (#309)
by
unknown
03:02
created

NullResource::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the League\Fractal package.
5
 *
6
 * (c) Phil Sturgeon <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace League\Fractal\Resource;
13
14
/**
15
 * Null Resource
16
 *
17
 * The Null Resource represents a resource that doesn't exist. This can be
18
 * useful to indicate that a certain relationship is null in some output
19
 * formats (e.g. JSON API), which require even a relationship that is null at
20
 * the moment to be listed.
21
 */
22
class NullResource extends ResourceAbstract
23
{
24
    /**
25
     * Get the data.
26
     *
27
     * @return mixed
28
     */
29 4
    public function getData()
30
    {
31
        // Null has no data associated with it.
32 4
    }
33
}
34