FileStorageData::getPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * This file is part of laravel-quota
5
 *
6
 * (c) David Faith <[email protected]>
7
 *
8
 * Full copyright and license information is available
9
 * in the LICENSE file distributed with this source code.
10
 */
11
12
namespace Projectmentor\Quota\Stubs;
13
14
use Projectmentor\Quota\Contracts\PayloadInterface;
15
use Projectmentor\Quota\Contracts\FactoryInterface;
16
17
/**
18
 * This is the filestorage data class.
19
 *
20
 * It stubs constructor parameters for:
21
 * bandwithThottle\tokenBucket\storage\FileStorage
22
 *
23
 * Initial properties for a new FileStorage instance via
24
 * \Projectmentor\Quota\Factories\FactoryInterface
25
 *
26
 * @author David Faith <[email protected]>
27
 */
28
class FileStorageData implements PayloadInterface
29
{
30
    /**
31
     * The path to persistant storage
32
     * @var string
33
     */
34
    protected $path;
35
36
    /**
37
     * Initialize $this
38
     * @param string $path to persistant storage
39
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
40
     */
41
    public function __construct($path)
42
    {
43
        //TODO: validate
44
        $this->path = $path;
45
    }
46
47
    /**
48
     * Get the path attribute.
49
     *
50
     * @return string
51
     */
52
    public function getPath()
53
    {
54
        return $this->path;
55
    }
56
57
    /**
58
     * Implements PayloadInterface
59
     * emit json payload.
60
     * @return string
61
     */
62
    public function toJson()
63
    {
64
        return 'Hi';
65
    }
66
67
    /**
68
     * Implements PayloadInterface
69
     * emit array payload.
70
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be string[]?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
71
     */
72
    public function toArray()
73
    {
74
        return ['Hi'];
75
    }
76
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
77