| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 27 | public function __construct($class, CacheInterface $cache = null) |
|
| 27 | {
|
||
| 28 | 27 | if (is_object($class)) {
|
|
| 29 | 26 | $declaredClass = get_class($class); |
|
| 30 | } else {
|
||
| 31 | 1 | $declaredClass = $class; |
|
| 32 | } |
||
| 33 | |||
| 34 | 27 | if (empty($declaredClass)) {
|
|
| 35 | 1 | throw new EmptyClassException(); |
|
| 36 | } |
||
| 37 | |||
| 38 | 26 | $this->reflectionClass = new \ReflectionClass($declaredClass); |
|
| 39 | 26 | $this->annotationParser = new AnnotationParser(); |
|
| 40 | 26 | $this->cache = $cache; |
|
| 41 | 26 | } |
|
| 43 |