Left   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 4 1
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
}