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

unsupportedLocalizedReflectionProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
crap 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