UnsupportedObjectException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 1
nop 1
1
<?php
2
3
declare (strict_types=1);
4
5
namespace Oxidmod\RestBundle\Transformer\Exception;
6
7
/**
8
 * Exception thrown if try to transform unsupported object
9
 */
10
class UnsupportedObjectException extends \LogicException
11
{
12
    /**
13
     * @param mixed $object
14
     */
15
    public function __construct($object)
16
    {
17
        parent::__construct(
18
            sprintf(
19
                'Transformer for "%s" not found.',
20
                is_object($object) ? get_class($object) : gettype($object)
21
            )
22
        );
23
    }
24
}
25