Completed
Push — php7/eduard ( ce4c1b )
by
unknown
02:08
created

Form::getX()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Kata\OtherExamples;
4
5
class Form
6
{
7
    private $x;
8
9
    /**
10
     * Form constructor.
11
     *
12
     * @param $x
13
     */
14
    public function __construct($x)
15
    {
16
        $this->x = $x;
17
    }
18
19
    function getX()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
20
    {
21
        //returns closure bound to this object and scope
22
        return function ()
23
        {
24
            return $this->x;
25
        };
26
    }
27
28
}