@@ -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 | |
@@ -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'; |
@@ -89,12 +89,14 @@ |
||
| 89 | 89 | * @return boolean|Document Returns false if no document could be created |
| 90 | 90 | */ |
| 91 | 91 | public function createDocument(ObjectManager $manager, $object) { |
| 92 | - if(!$this->isIndexable($object)) |
|
| 93 | - return false; |
|
| 92 | + if(!$this->isIndexable($object)) { |
|
| 93 | + return false; |
|
| 94 | + } |
|
| 94 | 95 | $document = $this->getSearchService($manager)->createEmptyDocumentFromEntity($object); |
| 95 | 96 | $index = $this->fillDocument($document, $object); |
| 96 | - if($index == false) |
|
| 97 | - return false; |
|
| 97 | + if($index == false) { |
|
| 98 | + return false; |
|
| 99 | + } |
|
| 98 | 100 | |
| 99 | 101 | return $document; |
| 100 | 102 | } |
@@ -66,8 +66,9 @@ |
||
| 66 | 66 | $choices = array(); |
| 67 | 67 | |
| 68 | 68 | foreach($facets as $facet => $count) { |
| 69 | - if($count == 0) |
|
| 70 | - break; |
|
| 69 | + if($count == 0) { |
|
| 70 | + break; |
|
| 71 | + } |
|
| 71 | 72 | $choices[$facet] = $facet . ' (' . $count . ')'; |
| 72 | 73 | } |
| 73 | 74 | return $choices; |