Test Failed
Push — develop ( 90366f...812a46 )
by Adrien
28:16
created

FinancialTest   F

Complexity

Total Complexity 63

Size/Duplication

Total Lines 507
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 507
rs 3.6585
c 0
b 0
f 0
wmc 63

63 Methods

Rating   Name   Duplication   Size   Complexity  
A testCUMIPMT() 0 4 1
A testPRICE() 0 6 1
A testCOUPNCD() 0 4 1
A testRATE() 0 6 1
A testACCRINTM() 0 4 1
A testAMORDEGRC() 0 4 1
A providerRATE() 0 3 1
A providerAMORLINC() 0 3 1
A providerFV() 0 3 1
A testDOLLARDE() 0 4 1
A providerDDB() 0 3 1
A providerNOMINAL() 0 3 1
A providerFVSCHEDULE() 0 3 1
A providerMIRR() 0 3 1
A testFV() 0 4 1
A providerCOUPNUM() 0 3 1
A providerINTRATE() 0 3 1
A testNOMINAL() 0 4 1
A testDDB() 0 4 1
A testFVSCHEDULE() 0 4 1
A testCOUPNUM() 0 4 1
A providerCUMIPMT() 0 3 1
A providerISPMT() 0 3 1
A providerAMORDEGRC() 0 3 1
A providerACCRINT() 0 3 1
A providerEFFECT() 0 3 1
A testDB() 0 4 1
A providerNPV() 0 3 1
A testNPER() 0 4 1
A providerPRICE() 0 3 1
A providerIPMT() 0 3 1
A providerIRR() 0 3 1
A providerACCRINTM() 0 3 1
A testNPV() 0 4 1
A providerCOUPPCD() 0 3 1
A testIRR() 0 4 1
A providerXIRR() 0 3 1
A testINTRATE() 0 4 1
A testDOLLARFR() 0 4 1
A testCUMPRINC() 0 4 1
A testIPMT() 0 4 1
A providerCOUPNCD() 0 3 1
A providerCOUPDAYSNC() 0 3 1
A setUp() 0 3 1
A testCOUPDAYBS() 0 4 1
A providerDOLLARDE() 0 3 1
A testXIRR() 0 6 1
A providerNPER() 0 3 1
A testAMORLINC() 0 4 1
A providerCOUPDAYS() 0 3 1
A testDISC() 0 4 1
A testISPMT() 0 4 1
A testCOUPPCD() 0 4 1
A testMIRR() 0 4 1
A testEFFECT() 0 4 1
A providerCOUPDAYBS() 0 3 1
A testCOUPDAYS() 0 4 1
A providerDB() 0 3 1
A providerDOLLARFR() 0 3 1
A providerCUMPRINC() 0 3 1
A testCOUPDAYSNC() 0 4 1
A providerDISC() 0 3 1
A testACCRINT() 0 4 1

How to fix   Complexity   

Complex Class

Complex classes like FinancialTest often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use FinancialTest, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
4
5
use PhpOffice\PhpSpreadsheet\Calculation\Financial;
6
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
7
use PHPUnit\Framework\TestCase;
8
9
class FinancialTest extends TestCase
10
{
11
    public function setUp()
12
    {
13
        Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
14
    }
15
16
    /**
17
     * @dataProvider providerACCRINT
18
     *
19
     * @param mixed $expectedResult
20
     */
21
    public function testACCRINT($expectedResult, ...$args)
22
    {
23
        $result = Financial::ACCRINT(...$args);
1 ignored issue
show
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...on\Financial::ACCRINT() has too few arguments starting with firstinterest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        /** @scrutinizer ignore-call */ 
24
        $result = Financial::ACCRINT(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
$args is expanded, but the parameter $issue of PhpOffice\PhpSpreadsheet...on\Financial::ACCRINT() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
        $result = Financial::ACCRINT(/** @scrutinizer ignore-type */ ...$args);
Loading history...
24
        self::assertEquals($expectedResult, $result, null, 1E-8);
25
    }
26
27
    public function providerACCRINT()
28
    {
29
        return require 'data/Calculation/Financial/ACCRINT.php';
30
    }
31
32
    /**
33
     * @dataProvider providerACCRINTM
34
     *
35
     * @param mixed $expectedResult
36
     */
37
    public function testACCRINTM($expectedResult, ...$args)
38
    {
39
        $result = Financial::ACCRINTM(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $issue of PhpOffice\PhpSpreadsheet...n\Financial::ACCRINTM() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

39
        $result = Financial::ACCRINTM(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...n\Financial::ACCRINTM() has too few arguments starting with settlement. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
        /** @scrutinizer ignore-call */ 
40
        $result = Financial::ACCRINTM(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
40
        self::assertEquals($expectedResult, $result, null, 1E-8);
41
    }
42
43
    public function providerACCRINTM()
44
    {
45
        return require 'data/Calculation/Financial/ACCRINTM.php';
46
    }
47
48
    /**
49
     * @dataProvider providerAMORDEGRC
50
     *
51
     * @param mixed $expectedResult
52
     */
53
    public function testAMORDEGRC($expectedResult, ...$args)
54
    {
55
        $result = Financial::AMORDEGRC(...$args);
1 ignored issue
show
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...\Financial::AMORDEGRC() has too few arguments starting with purchased. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

55
        /** @scrutinizer ignore-call */ 
56
        $result = Financial::AMORDEGRC(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
$args is expanded, but the parameter $cost of PhpOffice\PhpSpreadsheet...\Financial::AMORDEGRC() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

55
        $result = Financial::AMORDEGRC(/** @scrutinizer ignore-type */ ...$args);
Loading history...
56
        self::assertEquals($expectedResult, $result, null, 1E-8);
57
    }
58
59
    public function providerAMORDEGRC()
60
    {
61
        return require 'data/Calculation/Financial/AMORDEGRC.php';
62
    }
63
64
    /**
65
     * @dataProvider providerAMORLINC
66
     *
67
     * @param mixed $expectedResult
68
     */
69
    public function testAMORLINC($expectedResult, ...$args)
70
    {
71
        $result = Financial::AMORLINC(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $cost of PhpOffice\PhpSpreadsheet...n\Financial::AMORLINC() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

71
        $result = Financial::AMORLINC(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...n\Financial::AMORLINC() has too few arguments starting with purchased. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

71
        /** @scrutinizer ignore-call */ 
72
        $result = Financial::AMORLINC(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
72
        self::assertEquals($expectedResult, $result, null, 1E-8);
73
    }
74
75
    public function providerAMORLINC()
76
    {
77
        return require 'data/Calculation/Financial/AMORLINC.php';
78
    }
79
80
    /**
81
     * @dataProvider providerCOUPDAYBS
82
     *
83
     * @param mixed $expectedResult
84
     */
85
    public function testCOUPDAYBS($expectedResult, ...$args)
86
    {
87
        $result = Financial::COUPDAYBS(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...\Financial::COUPDAYBS() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

87
        $result = Financial::COUPDAYBS(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...\Financial::COUPDAYBS() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

87
        /** @scrutinizer ignore-call */ 
88
        $result = Financial::COUPDAYBS(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
88
        self::assertEquals($expectedResult, $result, null, 1E-8);
89
    }
90
91
    public function providerCOUPDAYBS()
92
    {
93
        return require 'data/Calculation/Financial/COUPDAYBS.php';
94
    }
95
96
    /**
97
     * @dataProvider providerCOUPDAYS
98
     *
99
     * @param mixed $expectedResult
100
     */
101
    public function testCOUPDAYS($expectedResult, ...$args)
102
    {
103
        $result = Financial::COUPDAYS(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...n\Financial::COUPDAYS() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

103
        $result = Financial::COUPDAYS(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...n\Financial::COUPDAYS() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

103
        /** @scrutinizer ignore-call */ 
104
        $result = Financial::COUPDAYS(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
104
        self::assertEquals($expectedResult, $result, null, 1E-8);
105
    }
106
107
    public function providerCOUPDAYS()
108
    {
109
        return require 'data/Calculation/Financial/COUPDAYS.php';
110
    }
111
112
    /**
113
     * @dataProvider providerCOUPDAYSNC
114
     *
115
     * @param mixed $expectedResult
116
     */
117
    public function testCOUPDAYSNC($expectedResult, ...$args)
118
    {
119
        $result = Financial::COUPDAYSNC(...$args);
1 ignored issue
show
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...Financial::COUPDAYSNC() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

119
        /** @scrutinizer ignore-call */ 
120
        $result = Financial::COUPDAYSNC(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...Financial::COUPDAYSNC() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

119
        $result = Financial::COUPDAYSNC(/** @scrutinizer ignore-type */ ...$args);
Loading history...
120
        self::assertEquals($expectedResult, $result, null, 1E-8);
121
    }
122
123
    public function providerCOUPDAYSNC()
124
    {
125
        return require 'data/Calculation/Financial/COUPDAYSNC.php';
126
    }
127
128
    /**
129
     * @dataProvider providerCOUPNCD
130
     *
131
     * @param mixed $expectedResult
132
     */
133
    public function testCOUPNCD($expectedResult, ...$args)
134
    {
135
        $result = Financial::COUPNCD(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...on\Financial::COUPNCD() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

135
        $result = Financial::COUPNCD(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...on\Financial::COUPNCD() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

135
        /** @scrutinizer ignore-call */ 
136
        $result = Financial::COUPNCD(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
136
        self::assertEquals($expectedResult, $result, null, 1E-8);
137
    }
138
139
    public function providerCOUPNCD()
140
    {
141
        return require 'data/Calculation/Financial/COUPNCD.php';
142
    }
143
144
    /**
145
     * @dataProvider providerCOUPNUM
146
     *
147
     * @param mixed $expectedResult
148
     */
149
    public function testCOUPNUM($expectedResult, ...$args)
150
    {
151
        $result = Financial::COUPNUM(...$args);
1 ignored issue
show
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...on\Financial::COUPNUM() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

151
        /** @scrutinizer ignore-call */ 
152
        $result = Financial::COUPNUM(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...on\Financial::COUPNUM() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

151
        $result = Financial::COUPNUM(/** @scrutinizer ignore-type */ ...$args);
Loading history...
152
        self::assertEquals($expectedResult, $result, null, 1E-8);
153
    }
154
155
    public function providerCOUPNUM()
156
    {
157
        return require 'data/Calculation/Financial/COUPNUM.php';
158
    }
159
160
    /**
161
     * @dataProvider providerCOUPPCD
162
     *
163
     * @param mixed $expectedResult
164
     */
165
    public function testCOUPPCD($expectedResult, ...$args)
166
    {
167
        $result = Financial::COUPPCD(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...on\Financial::COUPPCD() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

167
        $result = Financial::COUPPCD(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...on\Financial::COUPPCD() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

167
        /** @scrutinizer ignore-call */ 
168
        $result = Financial::COUPPCD(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
168
        self::assertEquals($expectedResult, $result, null, 1E-8);
169
    }
170
171
    public function providerCOUPPCD()
172
    {
173
        return require 'data/Calculation/Financial/COUPPCD.php';
174
    }
175
176
    /**
177
     * @dataProvider providerCUMIPMT
178
     *
179
     * @param mixed $expectedResult
180
     */
181
    public function testCUMIPMT($expectedResult, ...$args)
182
    {
183
        $result = Financial::CUMIPMT(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $rate of PhpOffice\PhpSpreadsheet...on\Financial::CUMIPMT() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

183
        $result = Financial::CUMIPMT(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...on\Financial::CUMIPMT() has too few arguments starting with nper. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

183
        /** @scrutinizer ignore-call */ 
184
        $result = Financial::CUMIPMT(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
184
        self::assertEquals($expectedResult, $result, null, 1E-8);
185
    }
186
187
    public function providerCUMIPMT()
188
    {
189
        return require 'data/Calculation/Financial/CUMIPMT.php';
190
    }
191
192
    /**
193
     * @dataProvider providerCUMPRINC
194
     *
195
     * @param mixed $expectedResult
196
     */
197
    public function testCUMPRINC($expectedResult, ...$args)
198
    {
199
        $result = Financial::CUMPRINC(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $rate of PhpOffice\PhpSpreadsheet...n\Financial::CUMPRINC() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

199
        $result = Financial::CUMPRINC(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...n\Financial::CUMPRINC() has too few arguments starting with nper. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

199
        /** @scrutinizer ignore-call */ 
200
        $result = Financial::CUMPRINC(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
200
        self::assertEquals($expectedResult, $result, null, 1E-8);
201
    }
202
203
    public function providerCUMPRINC()
204
    {
205
        return require 'data/Calculation/Financial/CUMPRINC.php';
206
    }
207
208
    /**
209
     * @dataProvider providerDB
210
     *
211
     * @param mixed $expectedResult
212
     */
213
    public function testDB($expectedResult, ...$args)
214
    {
215
        $result = Financial::DB(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $cost of PhpOffice\PhpSpreadsheet...ulation\Financial::DB() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

215
        $result = Financial::DB(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...ulation\Financial::DB() has too few arguments starting with salvage. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

215
        /** @scrutinizer ignore-call */ 
216
        $result = Financial::DB(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
216
        self::assertEquals($expectedResult, $result, null, 1E-8);
217
    }
218
219
    public function providerDB()
220
    {
221
        return require 'data/Calculation/Financial/DB.php';
222
    }
223
224
    /**
225
     * @dataProvider providerDDB
226
     *
227
     * @param mixed $expectedResult
228
     */
229
    public function testDDB($expectedResult, ...$args)
230
    {
231
        $result = Financial::DDB(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $cost of PhpOffice\PhpSpreadsheet...lation\Financial::DDB() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

231
        $result = Financial::DDB(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...lation\Financial::DDB() has too few arguments starting with salvage. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

231
        /** @scrutinizer ignore-call */ 
232
        $result = Financial::DDB(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
232
        self::assertEquals($expectedResult, $result, null, 1E-8);
233
    }
234
235
    public function providerDDB()
236
    {
237
        return require 'data/Calculation/Financial/DDB.php';
238
    }
239
240
    /**
241
     * @dataProvider providerDISC
242
     *
243
     * @param mixed $expectedResult
244
     */
245
    public function testDISC($expectedResult, ...$args)
246
    {
247
        $result = Financial::DISC(...$args);
1 ignored issue
show
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...ation\Financial::DISC() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

247
        /** @scrutinizer ignore-call */ 
248
        $result = Financial::DISC(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...ation\Financial::DISC() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

247
        $result = Financial::DISC(/** @scrutinizer ignore-type */ ...$args);
Loading history...
248
        self::assertEquals($expectedResult, $result, null, 1E-8);
249
    }
250
251
    public function providerDISC()
252
    {
253
        return require 'data/Calculation/Financial/DISC.php';
254
    }
255
256
    /**
257
     * @dataProvider providerDOLLARDE
258
     *
259
     * @param mixed $expectedResult
260
     */
261
    public function testDOLLARDE($expectedResult, ...$args)
262
    {
263
        $result = Financial::DOLLARDE(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $fractional_dollar of PhpOffice\PhpSpreadsheet...n\Financial::DOLLARDE() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

263
        $result = Financial::DOLLARDE(/** @scrutinizer ignore-type */ ...$args);
Loading history...
264
        self::assertEquals($expectedResult, $result, null, 1E-8);
265
    }
266
267
    public function providerDOLLARDE()
268
    {
269
        return require 'data/Calculation/Financial/DOLLARDE.php';
270
    }
271
272
    /**
273
     * @dataProvider providerDOLLARFR
274
     *
275
     * @param mixed $expectedResult
276
     */
277
    public function testDOLLARFR($expectedResult, ...$args)
278
    {
279
        $result = Financial::DOLLARFR(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $decimal_dollar of PhpOffice\PhpSpreadsheet...n\Financial::DOLLARFR() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

279
        $result = Financial::DOLLARFR(/** @scrutinizer ignore-type */ ...$args);
Loading history...
280
        self::assertEquals($expectedResult, $result, null, 1E-8);
281
    }
282
283
    public function providerDOLLARFR()
284
    {
285
        return require 'data/Calculation/Financial/DOLLARFR.php';
286
    }
287
288
    /**
289
     * @dataProvider providerEFFECT
290
     *
291
     * @param mixed $expectedResult
292
     */
293
    public function testEFFECT($expectedResult, ...$args)
294
    {
295
        $result = Financial::EFFECT(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $nominal_rate of PhpOffice\PhpSpreadsheet...ion\Financial::EFFECT() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

295
        $result = Financial::EFFECT(/** @scrutinizer ignore-type */ ...$args);
Loading history...
296
        self::assertEquals($expectedResult, $result, null, 1E-8);
297
    }
298
299
    public function providerEFFECT()
300
    {
301
        return require 'data/Calculation/Financial/EFFECT.php';
302
    }
303
304
    /**
305
     * @dataProvider providerFV
306
     *
307
     * @param mixed $expectedResult
308
     */
309
    public function testFV($expectedResult, ...$args)
310
    {
311
        $result = Financial::FV(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $rate of PhpOffice\PhpSpreadsheet...ulation\Financial::FV() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

311
        $result = Financial::FV(/** @scrutinizer ignore-type */ ...$args);
Loading history...
312
        self::assertEquals($expectedResult, $result, null, 1E-8);
313
    }
314
315
    public function providerFV()
316
    {
317
        return require 'data/Calculation/Financial/FV.php';
318
    }
319
320
    /**
321
     * @dataProvider providerFVSCHEDULE
322
     *
323
     * @param mixed $expectedResult
324
     */
325
    public function testFVSCHEDULE($expectedResult, ...$args)
326
    {
327
        $result = Financial::FVSCHEDULE(...$args);
1 ignored issue
show
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...Financial::FVSCHEDULE() has too few arguments starting with schedule. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

327
        /** @scrutinizer ignore-call */ 
328
        $result = Financial::FVSCHEDULE(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
$args is expanded, but the parameter $principal of PhpOffice\PhpSpreadsheet...Financial::FVSCHEDULE() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

327
        $result = Financial::FVSCHEDULE(/** @scrutinizer ignore-type */ ...$args);
Loading history...
328
        self::assertEquals($expectedResult, $result, null, 1E-8);
329
    }
330
331
    public function providerFVSCHEDULE()
332
    {
333
        return require 'data/Calculation/Financial/FVSCHEDULE.php';
334
    }
335
336
    /**
337
     * @dataProvider providerINTRATE
338
     *
339
     * @param mixed $expectedResult
340
     */
341
    public function testINTRATE($expectedResult, ...$args)
342
    {
343
        $result = Financial::INTRATE(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $settlement of PhpOffice\PhpSpreadsheet...on\Financial::INTRATE() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

343
        $result = Financial::INTRATE(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...on\Financial::INTRATE() has too few arguments starting with maturity. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

343
        /** @scrutinizer ignore-call */ 
344
        $result = Financial::INTRATE(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
344
        self::assertEquals($expectedResult, $result, null, 1E-8);
345
    }
346
347
    public function providerINTRATE()
348
    {
349
        return require 'data/Calculation/Financial/INTRATE.php';
350
    }
351
352
    /**
353
     * @dataProvider providerIPMT
354
     *
355
     * @param mixed $expectedResult
356
     */
357
    public function testIPMT($expectedResult, ...$args)
358
    {
359
        $result = Financial::IPMT(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $rate of PhpOffice\PhpSpreadsheet...ation\Financial::IPMT() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

359
        $result = Financial::IPMT(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...ation\Financial::IPMT() has too few arguments starting with per. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

359
        /** @scrutinizer ignore-call */ 
360
        $result = Financial::IPMT(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
360
        self::assertEquals($expectedResult, $result, null, 1E-8);
361
    }
362
363
    public function providerIPMT()
364
    {
365
        return require 'data/Calculation/Financial/IPMT.php';
366
    }
367
368
    /**
369
     * @dataProvider providerIRR
370
     *
371
     * @param mixed $expectedResult
372
     */
373
    public function testIRR($expectedResult, ...$args)
374
    {
375
        $result = Financial::IRR(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $values of PhpOffice\PhpSpreadsheet...lation\Financial::IRR() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

375
        $result = Financial::IRR(/** @scrutinizer ignore-type */ ...$args);
Loading history...
376
        self::assertEquals($expectedResult, $result, null, 1E-8);
377
    }
378
379
    public function providerIRR()
380
    {
381
        return require 'data/Calculation/Financial/IRR.php';
382
    }
383
384
    /**
385
     * @dataProvider providerISPMT
386
     *
387
     * @param mixed $expectedResult
388
     */
389
    public function testISPMT($expectedResult, ...$args)
390
    {
391
        $result = Financial::ISPMT(...$args);
392
        self::assertEquals($expectedResult, $result, null, 1E-8);
393
    }
394
395
    public function providerISPMT()
396
    {
397
        return require 'data/Calculation/Financial/ISPMT.php';
398
    }
399
400
    /**
401
     * @dataProvider providerMIRR
402
     *
403
     * @param mixed $expectedResult
404
     */
405
    public function testMIRR($expectedResult, ...$args)
406
    {
407
        $result = Financial::MIRR(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $values of PhpOffice\PhpSpreadsheet...ation\Financial::MIRR() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

407
        $result = Financial::MIRR(/** @scrutinizer ignore-type */ ...$args);
Loading history...
Bug introduced by
The call to PhpOffice\PhpSpreadsheet...ation\Financial::MIRR() has too few arguments starting with finance_rate. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

407
        /** @scrutinizer ignore-call */ 
408
        $result = Financial::MIRR(...$args);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
408
        self::assertEquals($expectedResult, $result, null, 1E-8);
409
    }
410
411
    public function providerMIRR()
412
    {
413
        return require 'data/Calculation/Financial/MIRR.php';
414
    }
415
416
    /**
417
     * @dataProvider providerNOMINAL
418
     *
419
     * @param mixed $expectedResult
420
     */
421
    public function testNOMINAL($expectedResult, ...$args)
422
    {
423
        $result = Financial::NOMINAL(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $effect_rate of PhpOffice\PhpSpreadsheet...on\Financial::NOMINAL() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

423
        $result = Financial::NOMINAL(/** @scrutinizer ignore-type */ ...$args);
Loading history...
424
        self::assertEquals($expectedResult, $result, null, 1E-8);
425
    }
426
427
    public function providerNOMINAL()
428
    {
429
        return require 'data/Calculation/Financial/NOMINAL.php';
430
    }
431
432
    /**
433
     * @dataProvider providerNPER
434
     *
435
     * @param mixed $expectedResult
436
     */
437
    public function testNPER($expectedResult, ...$args)
438
    {
439
        $result = Financial::NPER(...$args);
1 ignored issue
show
Bug introduced by
$args is expanded, but the parameter $rate of PhpOffice\PhpSpreadsheet...ation\Financial::NPER() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

439
        $result = Financial::NPER(/** @scrutinizer ignore-type */ ...$args);
Loading history...
440
        self::assertEquals($expectedResult, $result, null, 1E-8);
441
    }
442
443
    public function providerNPER()
444
    {
445
        return require 'data/Calculation/Financial/NPER.php';
446
    }
447
448
    /**
449
     * @dataProvider providerNPV
450
     *
451
     * @param mixed $expectedResult
452
     */
453
    public function testNPV($expectedResult, ...$args)
454
    {
455
        $result = Financial::NPV(...$args);
456
        self::assertEquals($expectedResult, $result, null, 1E-8);
457
    }
458
459
    public function providerNPV()
460
    {
461
        return require 'data/Calculation/Financial/NPV.php';
462
    }
463
464
    /**
465
     * @dataProvider providerPRICE
466
     *
467
     * @param mixed $expectedResult
468
     */
469
    public function testPRICE($expectedResult, ...$args)
470
    {
471
        $this->markTestIncomplete('TODO: This test should be fixed');
472
473
        $result = Financial::PRICE(...$args);
474
        self::assertEquals($expectedResult, $result, null, 1E-8);
475
    }
476
477
    public function providerPRICE()
478
    {
479
        return require 'data/Calculation/Financial/PRICE.php';
480
    }
481
482
    /**
483
     * @dataProvider providerRATE
484
     *
485
     * @param mixed $expectedResult
486
     */
487
    public function testRATE($expectedResult, ...$args)
488
    {
489
        $this->markTestIncomplete('TODO: This test should be fixed');
490
491
        $result = Financial::RATE(...$args);
492
        self::assertEquals($expectedResult, $result, null, 1E-8);
493
    }
494
495
    public function providerRATE()
496
    {
497
        return require 'data/Calculation/Financial/RATE.php';
498
    }
499
500
    /**
501
     * @dataProvider providerXIRR
502
     *
503
     * @param mixed $expectedResult
504
     */
505
    public function testXIRR($expectedResult, ...$args)
506
    {
507
        $this->markTestIncomplete('TODO: This test should be fixed');
508
509
        $result = Financial::XIRR(...$args);
510
        self::assertEquals($expectedResult, $result, null, 1E-8);
511
    }
512
513
    public function providerXIRR()
514
    {
515
        return require 'data/Calculation/Financial/XIRR.php';
516
    }
517
}
518