Code Duplication    Length = 14-20 lines in 2 locations

src/Surfnet/StepupRa/RaBundle/Exception/InvalidArgumentException.php 1 location

@@ 21-40 (lines=20) @@
18
19
namespace Surfnet\StepupRa\RaBundle\Exception;
20
21
class InvalidArgumentException extends \InvalidArgumentException
22
{
23
    /**
24
     * @param string $expected description of expected type
25
     * @param string $parameterName
26
     * @param mixed $parameter the parameter that is not of the expected type.
27
     * @return self
28
     */
29
    public static function invalidType($expected, $parameterName, $parameter)
30
    {
31
        $message = sprintf(
32
            'Invalid argument type: "%s" expected, "%s" given for "%s"',
33
            $expected,
34
            is_object($parameter) ? get_class($parameter) : gettype($parameter),
35
            $parameterName
36
        );
37
38
        return new self($message);
39
    }
40
}
41

src/Surfnet/StepupRa/SamlStepupProviderBundle/Exception/InvalidArgumentException.php 1 location

@@ 23-36 (lines=14) @@
20
21
use InvalidArgumentException as CoreInvalidArgumentException;
22
23
class InvalidArgumentException extends CoreInvalidArgumentException
24
{
25
    public static function invalidType($expectedType, $parameter, $value)
26
    {
27
        return new self(
28
            sprintf(
29
                'Invalid Argument, parameter "%s" should be of type "%s", "%s" given',
30
                $parameter,
31
                $expectedType,
32
                is_object($value) ? get_class($value) : gettype($value)
33
            )
34
        );
35
    }
36
}
37