Completed
Pull Request — master (#47)
by Freek
04:15
created

InvalidFractalHelperArgument::tooManyArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\Fractal\Exceptions;
4
5
use InvalidArgumentException;
6
7
class InvalidFractalHelperArgument extends InvalidArgumentException
8
{
9
    public static function secondArgumentMissing()
10
    {
11
        return new static('The second argument should be a callable or extend `League\\Fractal\\TransformerAbstract`');
12
    }
13
14
    public static function tooManyArguments(array $arguments)
15
    {
16
        $argumentCount = count($arguments);
17
18
        return new static("You passed {$argumentCount} to `fractal()`. The maximum amount of arguments is 3.");
19
    }
20
21
    public static function invalidTransformer()
22
    {
23
        return new static('The second argument should be a callable or extend `League\\Fractal\\TransformerAbstract`');
24
    }
25
}
26