@@ -13,13 +13,11 @@ |
||
13 | 13 | |
14 | 14 | namespace StingerSoft\EntitySearchBundle\Command; |
15 | 15 | |
16 | -use Doctrine\Common\Persistence\ObjectManager; |
|
17 | 16 | use Doctrine\DBAL\Platforms\SQLServerPlatform; |
18 | 17 | use Doctrine\ORM\EntityManager; |
19 | 18 | use Doctrine\ORM\Mapping\ClassMetadata; |
20 | 19 | use StingerSoft\EntitySearchBundle\Services\Mapping\EntityToDocumentMapperInterface; |
21 | 20 | use StingerSoft\EntitySearchBundle\Services\SearchService; |
22 | -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
|
23 | 21 | use Symfony\Component\Console\Command\Command; |
24 | 22 | use Symfony\Component\Console\Helper\ProgressBar; |
25 | 23 | use Symfony\Component\Console\Input\InputArgument; |
@@ -107,12 +107,14 @@ |
||
107 | 107 | * @see \StingerSoft\EntitySearchBundle\Services\Mapping\EntityToDocumentMapperInterface::createDocument() |
108 | 108 | */ |
109 | 109 | public function createDocument(ObjectManager $manager, object $object) : ?Document { |
110 | - if(!$this->isIndexable($object)) |
|
111 | - return null; |
|
110 | + if(!$this->isIndexable($object)) { |
|
111 | + return null; |
|
112 | + } |
|
112 | 113 | $document = $this->searchService->createEmptyDocumentFromEntity($object); |
113 | 114 | $index = $this->fillDocument($document, $object); |
114 | - if($index === false) |
|
115 | - return null; |
|
115 | + if($index === false) { |
|
116 | + return null; |
|
117 | + } |
|
116 | 118 | |
117 | 119 | return $document; |
118 | 120 | } |
@@ -131,7 +131,9 @@ |
||
131 | 131 | * @param LifecycleEventArgs $args |
132 | 132 | */ |
133 | 133 | public function postUpdate(LifecycleEventArgs $args): void { |
134 | - if(!$this->enableIndexing) return; |
|
134 | + if(!$this->enableIndexing) { |
|
135 | + return; |
|
136 | + } |
|
135 | 137 | $this->updateEntity($args->getObject(), $args->getObjectManager()); |
136 | 138 | } |
137 | 139 |
@@ -18,7 +18,6 @@ |
||
18 | 18 | use Symfony\Component\Form\FormEvent; |
19 | 19 | use Symfony\Component\Form\FormEvents; |
20 | 20 | use Symfony\Component\OptionsResolver\OptionsResolver; |
21 | -use Symfony\Component\HttpKernel\Kernel; |
|
22 | 21 | |
23 | 22 | class FacetType extends AbstractType { |
24 | 23 |
@@ -14,7 +14,6 @@ |
||
14 | 14 | |
15 | 15 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
16 | 16 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
17 | -use Symfony\Component\HttpKernel\Kernel; |
|
18 | 17 | |
19 | 18 | |
20 | 19 | /** |
@@ -53,8 +53,9 @@ |
||
53 | 53 | * @required |
54 | 54 | */ |
55 | 55 | public function setObjectManager(EntityManagerInterface $om): void { |
56 | - if($this->objectManager) |
|
57 | - return; |
|
56 | + if($this->objectManager) { |
|
57 | + return; |
|
58 | + } |
|
58 | 59 | $this->objectManager = $om; |
59 | 60 | } |
60 | 61 |