Completed
Pull Request — master (#10)
by Gabriel
60:20
created

AddressChangeContextFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 14
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A newMappingDriver() 0 5 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\AddressChangeContext;
6
7
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
8
use Doctrine\ORM\Mapping\Driver\XmlDriver;
9
10
/**
11
 * @licence GNU GPL v2+
12
 */
13
class AddressChangeContextFactory {
14
15
	/**
16
	 * Use this constant for MappingDriverChain::addDriver
17
	 */
18
	public const ENTITY_NAMESPACE = 'WMDE\Fundraising\AddressChangeContext\Domain\Model';
19
20
	private const DOCTRINE_CLASS_MAPPING_DIRECTORY = __DIR__ . '/../config/DoctrineClassMapping';
21
22
	public function newMappingDriver(): MappingDriver {
23
		// We're only calling this for the side effect of adding Mapping/Driver/DoctrineAnnotations.php
24
		// to the AnnotationRegistry. When AnnotationRegistry is deprecated with Doctrine Annotations 2.0,
25
		// use $this->annotationReader instead
26
		return new XmlDriver( self::DOCTRINE_CLASS_MAPPING_DIRECTORY );
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Doctrine\ORM\...LASS_MAPPING_DIRECTORY) returns the type Doctrine\ORM\Mapping\Driver\XmlDriver which is incompatible with the type-hinted return Doctrine\Common\Persiste...ng\Driver\MappingDriver.
Loading history...
27
	}
28
29
}
30