BaseSizeFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * This file is part of InFw\Size package.
5
 */
6
7
namespace InFw\Size;
8
9
use InFw\Range\BaseRange;
10
use InFw\Range\RangeInterface;
11
12
/**
13
 * Class BaseSizeFactory.
14
 */
15
class BaseSizeFactory implements SizeFactoryInterface
16
{
17
    /**
18
     * File size range.
19
     *
20
     * @var RangeInterface
21
     */
22
    private $range;
23
24
    /**
25
     * BaseSizeFactory constructor.
26
     *
27
     * @param int $minSize
28
     * @param int $maxSize
29
     */
30 3
    public function __construct($minSize, $maxSize)
31
    {
32 3
        $this->range = new BaseRange(
33 1
            $minSize,
34 2
            $maxSize
35 1
        );
36 3
    }
37
38
    /**
39
     * Create instances of Size object.
40
     *
41
     * @param int $size
42
     * @param int $minSize
0 ignored issues
show
Bug introduced by
There is no parameter named $minSize. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
43
     * @param int $maxSize
0 ignored issues
show
Bug introduced by
There is no parameter named $maxSize. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
44
     *
45
     * @return SizeInterface
46
     */
47 3
    public function make($size)
48
    {
49 3
        return new BaseSize(
50 1
            $size,
51 3
            $this->range
52 1
        );
53
    }
54
}
55