Completed
Push — master ( 33ee7a...35da7e )
by Gabriel
565:17 queued 500:16
created

BucketTestingContextFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A newMappingDriver() 0 5 1
1
<?php
2
3
namespace WMDE\Fundraising\Frontend\BucketTesting;
4
5
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
6
use Doctrine\ORM\Mapping\Driver\XmlDriver;
7
8
class BucketTestingContextFactory {
9
	public const ENTITY_NAMESPACE = 'WMDE\Fundraising\Frontend\BucketTesting\Domain\Model';
10
11
	private const DOCTRINE_CLASS_MAPPING_DIRECTORY = __DIR__ . '/config/DoctrineClassMapping';
12
13
	public function newMappingDriver(): MappingDriver {
14
		// We're only calling this for the side effect of adding Mapping/Driver/DoctrineAnnotations.php
15
		// to the AnnotationRegistry. When AnnotationRegistry is deprecated with Doctrine Annotations 2.0,
16
		// use $this->annotationReader instead
17
		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...
18
	}
19
}
20