ClassMetadata   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 37
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getReflectionClass() 0 8 2
A newInstance() 0 8 2
1
<?php
2
3
/**
4
 * This file is part of the Kdyby (http://www.kdyby.org)
5
 *
6
 * Copyright (c) 2008 Filip Procházka ([email protected])
7
 *
8
 * For the full copyright and license information, please view the file license.txt that was distributed with this source code.
9
 */
10
11
namespace Kdyby\Doctrine\Mapping;
12
13
use Doctrine;
14
use Kdyby;
15
use Nette;
16
17
18
19
/**
20
 * @author Filip Procházka <[email protected]>
21
 */
22
class ClassMetadata extends Doctrine\ORM\Mapping\ClassMetadata
23
{
24
25
	/**
26
	 * @var Doctrine\Instantiator\InstantiatorInterface|NULL
27
	 */
28
	private $instantiator;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
29
30
31
32
	/**
33
	 * {@inheritDoc}
34
	 */
35
	public function getReflectionClass()
36
	{
37
		if ($this->reflClass === NULL) {
38
			$this->reflClass = new Nette\Reflection\ClassType($this->name);
39
		}
40
41
		return $this->reflClass;
42
	}
43
44
45
46
	/**
47
	 * @return object
48
	 */
49
	public function newInstance()
50
	{
51
		if ($this->instantiator === NULL) {
52
			$this->instantiator = new Doctrine\Instantiator\Instantiator();
53
		}
54
55
		return $this->instantiator->instantiate($this->name);
56
	}
57
58
}
59