@@ -32,7 +32,9 @@ |
||
32 | 32 | * @see \StingerSoft\EntitySearchBundle\Services\SearchService::setObjectManager() |
33 | 33 | */ |
34 | 34 | public function setObjectManager(ObjectManager $om) { |
35 | - if($this->objectManager) return; |
|
35 | + if($this->objectManager) { |
|
36 | + return; |
|
37 | + } |
|
36 | 38 | $this->objectManager = $om; |
37 | 39 | } |
38 | 40 |
@@ -82,8 +82,9 @@ discard block |
||
82 | 82 | * @param object $entity |
83 | 83 | */ |
84 | 84 | protected function updateEntity($entity, ObjectManager $manager) { |
85 | - if(!($entity instanceof SearchableEntity)) |
|
86 | - return; |
|
85 | + if(!($entity instanceof SearchableEntity)) { |
|
86 | + return; |
|
87 | + } |
|
87 | 88 | $document = $this->getSearchService($manager)->createEmptyDocumentFromEntity($entity); |
88 | 89 | if($entity->indexEntity($document) !== false) { |
89 | 90 | $this->getSearchService($manager)->saveDocument($document); |
@@ -97,8 +98,9 @@ discard block |
||
97 | 98 | * @param object $entity |
98 | 99 | */ |
99 | 100 | protected function removeEntity($entity, ObjectManager $manager) { |
100 | - if(!($entity instanceof SearchableEntity)) |
|
101 | - return; |
|
101 | + if(!($entity instanceof SearchableEntity)) { |
|
102 | + return; |
|
103 | + } |
|
102 | 104 | $document = $this->getSearchService($manager)->createEmptyDocumentFromEntity($entity); |
103 | 105 | $this->getSearchService($manager)->removeDocument($document); |
104 | 106 | } |
@@ -9,12 +9,12 @@ |
||
9 | 9 | define('TESTS_TEMP_DIR', __DIR__.'/temp'); |
10 | 10 | define('VENDOR_PATH', realpath(__DIR__.'/../vendor')); |
11 | 11 | if (!class_exists('PHPUnit_Framework_TestCase') || |
12 | - version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0 |
|
12 | + version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0 |
|
13 | 13 | ) { |
14 | - die('PHPUnit framework is required, at least 3.5 version'); |
|
14 | + die('PHPUnit framework is required, at least 3.5 version'); |
|
15 | 15 | } |
16 | 16 | if (!class_exists('PHPUnit_Framework_MockObject_MockBuilder')) { |
17 | - die('PHPUnit MockObject plugin is required, at least 1.0.8 version'); |
|
17 | + die('PHPUnit MockObject plugin is required, at least 1.0.8 version'); |
|
18 | 18 | } |
19 | 19 | /** @var $loader ClassLoader */ |
20 | 20 | $loader = require __DIR__.'/../vendor/autoload.php'; |