SimpleInterestCalculatorFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A newSimpleInterest() 0 10 1
1
<?php
2
3
namespace FinanCalc\Calculators\Factories {
4
5
    use FinanCalc\Calculators\SimpleInterestCalculator;
6
    use FinanCalc\Interfaces\Calculator\CalculatorFactoryAbstract;
7
    use FinanCalc\Utils\Time\TimeSpan;
8
9
    /**
10
     * Class SimpleInterestCalculatorFactory
11
     * @package FinanCalc\Calculators\Factories
12
     */
13
    class SimpleInterestCalculatorFactory extends CalculatorFactoryAbstract
14
    {
15
        const MANUFACTURED_CLASS_NAME = 'FinanCalc\\Calculators\\SimpleInterestCalculator';
16
17
        /**
18
         * @param $principal
19
         * @param $annualInterestRate
20
         * @param TimeSpan $time
21
         * @return SimpleInterestCalculator
22
         */
23
        public function newSimpleInterest($principal, $annualInterestRate, TimeSpan $time)
24
        {
25
            return $this->manufactureInstance(
26
                [
27
                    $principal,
28
                    $annualInterestRate,
29
                    $time
30
                ]
31
            );
32
        }
33
    }
34
}
35