Code Duplication    Length = 20-20 lines in 2 locations

src/Surfnet/StepupMiddlewareClient/Exception/InvalidArgumentException.php 1 location

@@ 21-40 (lines=20) @@
18
19
namespace Surfnet\StepupMiddlewareClient\Exception;
20
21
class InvalidArgumentException extends \InvalidArgumentException implements StepupMiddlewareClientException
22
{
23
    /**
24
     * @param string $expected description of expected type
25
     * @param $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/StepupMiddlewareClientBundle/Exception/InvalidArgumentException.php 1 location

@@ 21-40 (lines=20) @@
18
19
namespace Surfnet\StepupMiddlewareClientBundle\Exception;
20
21
class InvalidArgumentException extends \InvalidArgumentException
22
{
23
    /**
24
     * @param string $expected description of expected type
25
     * @param $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