Completed
Pull Request — master (#391)
by Marco
07:35
created

UnsupportedProxiedClassException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A unsupportedLocalizedReflectionProperty() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManager\Exception;
6
7
use LogicException;
8
use ReflectionProperty;
9
10
/**
11
 * Exception for invalid proxied classes
12
 *
13
 * @author Marco Pivetta <[email protected]>
14
 * @license MIT
15
 */
16
class UnsupportedProxiedClassException extends LogicException implements ExceptionInterface
17
{
18 1
    public static function unsupportedLocalizedReflectionProperty(ReflectionProperty $property) : self
19
    {
20 1
        return new self(
21 1
            sprintf(
22 1
                'Provided reflection property "%s" of class "%s" is private and cannot be localized in PHP 5.3',
23 1
                $property->getName(),
24 1
                $property->getDeclaringClass()->getName()
25
            )
26
        );
27
    }
28
}
29