1 | <?php |
||
23 | abstract class StatementRepositoryTest extends BaseStatementRepositoryTest |
||
24 | { |
||
25 | /** |
||
26 | * @var ObjectManager |
||
27 | */ |
||
28 | protected $objectManager; |
||
29 | |||
30 | /** |
||
31 | * @var MappedStatementRepository |
||
32 | */ |
||
33 | protected $repository; |
||
34 | |||
35 | protected function setUp() |
||
36 | { |
||
37 | $this->objectManager = $this->createObjectManager(); |
||
38 | $this->repository = $this->createRepository(); |
||
|
|||
39 | |||
40 | parent::setUp(); |
||
41 | } |
||
42 | |||
43 | protected function createStatementRepository() |
||
44 | { |
||
45 | return new FreshStatementRepository(new StatementRepository($this->repository), $this->objectManager); |
||
46 | } |
||
47 | |||
48 | protected function cleanDatabase() |
||
49 | { |
||
50 | foreach ($this->repository->findStatements(array()) as $statement) { |
||
51 | $this->objectManager->remove($statement); |
||
52 | } |
||
53 | |||
54 | $this->objectManager->flush(); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return ObjectManager |
||
59 | */ |
||
60 | abstract protected function createObjectManager(); |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | abstract protected function getStatementClassName(); |
||
66 | |||
67 | private function createRepository() |
||
68 | { |
||
69 | return $this->objectManager->getRepository($this->getStatementClassName()); |
||
71 | } |
||
72 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..