Left::map()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DaveRoss\FunctionalProgrammingUtils;
4
5
/**
6
 * Class Left
7
 * Left Monad. Represents a failure or error state.
8
 * @package DaveRoss\FunctionalProgrammingUtils
9
 */
10
class Left extends Either
0 ignored issues
show
Coding Style introduced by
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
11
{
12
13
    /**
14
     * Return $this without applying the passed function
15
     *
16
     * @param callable $f
17
     *
18
     * @return Monad
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use Left.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
19
     */
20
    public function map(callable $f)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $f. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
21
    {
22
        return $this;
23
    }
24
}