MethodCallManager::assertArgsNumber()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 3
nc 2
nop 2
crap 2
1
<?php
2
3
namespace Accessible\MethodManager;
4
5
class MethodCallManager
6
{
7
    /**
8
     * Throws a BadMethodCallException if the number of arguments is not what we want.
9
     *
10
     * @param  int $numberOfArgs
11
     * @param  array $args
12
     */
13 33
    public static function assertArgsNumber($numberOfArgs, $args)
14
    {
15 33
        if (sizeof($args) !== $numberOfArgs) {
16 3
            throw new \BadMethodCallException("A wrong number of arguments has been given to the called method.");
17
        }
18 30
    }
19
}
20