Passed
Pull Request — master (#11)
by Gabriel
60:27
created

AddressChangeContextFactory::newEventSubscribers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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
	public function newEventSubscribers(): array {
30
		// Currently we don't have event subscribers, but this method helps to keep a consistent interface
31
		// with all the other context factories of the bounded contexts.
32
		return [];
33
	}
34
35
}
36