Completed
Push — master ( 729691...42bbe2 )
by Gaetano
25:36
created
Command/TestCommand.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
10 10
 use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
11 11
 use Kaliop\EzFindSearchEngineBundle\API\Repository\Values\Content\Query as KQuery;
12
-use Kaliop\EzFindSearchEngineBundle\API\Repository\Values\Content\Query\SortClause as KSortClause;
13 12
 use Kaliop\EzFindSearchEngineBundle\API\Repository\Values\Content\Query\Criterion as KCriterion;
14 13
 
15 14
 class TestCommand extends ContainerAwareCommand
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
         $legacyKernelClosure = $this->getContainer()->get('ezpublish_legacy.kernel');
29 29
         $legacyKernel = $legacyKernelClosure();
30 30
         $legacyKernel->runCallback(
31
-            function ()  {
31
+            function() {
32 32
                 $moduleRepositories = \eZModule::activeModuleRepositories(true);
33 33
                 $moduleRepositories[] = 'extension/ezfind/modules';
34 34
                 //var_dump($moduleRepositories);
35
-                \eZModule::setGlobalPathList( $moduleRepositories );
35
+                \eZModule::setGlobalPathList($moduleRepositories);
36 36
             },
37 37
             false
38 38
         );
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
         echo "count: "; var_dump(count($results->searchHits));
83 83
         echo "totalCount: "; var_dump($results->totalCount);
84 84
         echo "time (ms): "; var_dump($results->time);
85
-        echo "maxScore: ";  var_dump($results->maxScore);
85
+        echo "maxScore: "; var_dump($results->maxScore);
86 86
         echo "q: "; var_dump($results->searchExtras->attribute('responseHeader')['params']['q']);
87 87
         echo "fq: "; var_dump($results->searchExtras->attribute('responseHeader')['params']['fq']);
88 88
         echo "sort: "; var_dump($results->searchExtras->attribute('responseHeader')['params']['sort']);
89 89
 
90
-        foreach($results->searchHits as $i => $searchHit) {
90
+        foreach ($results->searchHits as $i => $searchHit) {
91 91
             /** @var Content $content */
92 92
             $content = $searchHit->valueObject;
93 93
             $score = $searchHit->score;
Please login to merge, or discard this patch.
eZFind/Content/Search/Common/Gateway/CriterionHandler/FieldIn.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,11 +3,8 @@
 block discarded – undo
3 3
 namespace Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriterionHandler;
4 4
 
5 5
 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
6
-use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
7 6
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriteriaConverter;
8 7
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriterionHandler;
9
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitor;
10
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitorDispatcher;
11 8
 
12 9
 /// @deprecated
13 10
 class FieldIn extends FieldBase
Please login to merge, or discard this patch.
eZFind/Content/Search/Common/Gateway/CriterionHandler/LocationId.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 
16 16
     /**
17 17
      * @param CriteriaConverter $converter
18
-     * @param SelectQuery $query
19 18
      * @param Criterion $criterion
20 19
      * @return string|string[]
21 20
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 class LocationId extends CriterionHandler
10 10
 {
11
-    public function accept( Criterion $criterion )
11
+    public function accept(Criterion $criterion)
12 12
     {
13 13
         return $criterion instanceof Criterion\LocationId;
14 14
     }
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      * @param Criterion $criterion
20 20
      * @return string|string[]
21 21
      */
22
-    public function handle( CriteriaConverter $converter, Criterion $criterion )
22
+    public function handle(CriteriaConverter $converter, Criterion $criterion)
23 23
     {
24 24
         $result = [];
25 25
 
Please login to merge, or discard this patch.
eZFind/Content/Search/Common/Gateway/CriterionHandler/LogicalAnd.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,6 @@
 block discarded – undo
5 5
 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
6 6
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriteriaConverter;
7 7
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriterionHandler;
8
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitor;
9
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitorDispatcher as Dispatcher;
10 8
 
11 9
 class LogicalAnd extends CriterionHandler
12 10
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         return array_merge(
21 21
             array('AND'),
22 22
             array_map(
23
-                function ($value) use ($converter) {
23
+                function($value) use ($converter) {
24 24
                     return $converter->handle($value);
25 25
                 },
26 26
                 $criterion->criteria
Please login to merge, or discard this patch.
eZFind/Content/Search/Common/Gateway/CriterionHandler/LogicalNot.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -2,14 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriterionHandler;
4 4
 
5
-use eZ\Publish\API\Repository\Values\Content\Query;
6 5
 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
7
-use eZ\Publish\Core\Persistence\Database\SelectQuery;
8 6
 use Kaliop\EzFindSearchEngineBundle\Core\Base\Exceptions\InvalidCriterionException;
9 7
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriteriaConverter;
10 8
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriterionHandler;
11
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitor;
12
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitorDispatcher as Dispatcher;
13 9
 
14 10
 class LogicalNot extends CriterionHandler
15 11
 {
Please login to merge, or discard this patch.
eZFind/Content/Search/Common/Gateway/CriterionHandler/LogicalOr.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
6 6
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriteriaConverter;
7
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitor;
8
-use Kaliop\EzFindSearchEngineBundle\Persistence\Solr\Content\Search\CriterionVisitorDispatcher as Dispatcher;
9 7
 use Kaliop\EzFindSearchEngineBundle\Core\Persistence\eZFind\Content\Search\Common\Gateway\CriterionHandler;
10 8
 
11 9
 class LogicalOr extends CriterionHandler
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         return array_merge(
21 21
             array('OR'),
22 22
             array_map(
23
-                function ($value) use ($converter) {
23
+                function($value) use ($converter) {
24 24
                     return $converter->handle($value);
25 25
                 },
26 26
                 $criterion->criteria
Please login to merge, or discard this patch.
eZFind/Content/Search/Common/Gateway/CriterionHandler/ObjectStateId.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 
16 16
     /**
17 17
      * @param CriteriaConverter $converter
18
-     * @param SelectQuery $query
19 18
      * @param Criterion $criterion
20 19
      * @return string|string[]
21 20
      *
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 class ObjectStateId extends CriterionHandler
10 10
 {
11
-    public function accept( Criterion $criterion )
11
+    public function accept(Criterion $criterion)
12 12
     {
13 13
         return $criterion instanceof Criterion\ObjectStateId;
14 14
     }
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @todo verify if handling of multiple states via OR is correct
23 23
      */
24
-    public function handle( CriteriaConverter $converter, Criterion $criterion )
24
+    public function handle(CriteriaConverter $converter, Criterion $criterion)
25 25
     {
26 26
         $result = [];
27 27
 
Please login to merge, or discard this patch.
Core/Repository/SearchService.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -345,6 +345,9 @@  discard block
 block discarded – undo
345 345
         return $searchParameters;
346 346
     }
347 347
 
348
+    /**
349
+     * @param string $paramName
350
+     */
348 351
     protected function extractLegacyParameter($paramName, Query $query)
349 352
     {
350 353
         switch ($paramName) {
@@ -422,6 +425,9 @@  discard block
 block discarded – undo
422 425
         return $facets;
423 426
     }
424 427
 
428
+    /**
429
+     * @param Query\SortClause[] $sortClauses
430
+     */
425 431
     protected function extractSort($sortClauses)
426 432
     {
427 433
         $result = [];
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
             // trick to access data from a protected member of ezfSearchResultInfo
135 135
             // @see http://blag.kazeno.net/development/access-private-protected-properties
136
-            $propGetter = Closure::bind(function($prop){return $this->$prop;}, $extras, $extras);
136
+            $propGetter = Closure::bind(function($prop) {return $this->$prop; }, $extras, $extras);
137 137
             $resultArray = $propGetter('ResultArray');
138 138
 
139 139
             if (isset($resultArray['response']['maxScore'])) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             // optimize: remove from SearchExtras 'response' to save memory using the 'Closure::bind' hack
144 144
             /// @todo (!important) make the cutover limit configurable
145 145
             if ($result['SearchCount'] > 100) {
146
-                $resultsCleaner = Closure::bind(function(){unset($this->ResultArray['response']['docs']);}, $extras, $extras);
146
+                $resultsCleaner = Closure::bind(function() {unset($this->ResultArray['response']['docs']); }, $extras, $extras);
147 147
                 $resultsCleaner();
148 148
             }
149 149
         }
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 //var_dump($searchParameters);
245 245
         /** @var array $searchResult */
246 246
         $searchResult = $this->getLegacyKernel()->runCallback(
247
-            function () use ($searchParameters) {
247
+            function() use ($searchParameters) {
248 248
                 return \eZFunctionHandler::execute($this->ezFindModule, $this->ezFindFunction, $searchParameters);
249 249
             },
250 250
             false
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 
521 521
             // trick to access data from a protected member of ezfSearchResultInfo
522 522
             // @see http://blag.kazeno.net/development/access-private-protected-properties
523
-            $propGetter = Closure::bind(function($prop){return $this->$prop;}, $extras, $extras);
523
+            $propGetter = Closure::bind(function($prop) {return $this->$prop; }, $extras, $extras);
524 524
             $resultArray = $propGetter('ResultArray');
525 525
             $searchResults = $resultArray['response']['docs'];
526 526
         }
@@ -532,16 +532,16 @@  discard block
 block discarded – undo
532 532
         $results = array();
533 533
 
534 534
         foreach ($searchResults as $index => $result) {
535
-            switch($returnType) {
535
+            switch ($returnType) {
536 536
 
537 537
                 case KaliopQuery::RETURN_CONTENTS:
538 538
                     try {
539 539
                         $results[$index] = new SearchHit(
540 540
                             [
541 541
                                 'valueObject' => $this->contentService->loadContent($result['id']),
542
-                                'score' => isset($result['score'])? $result['score'] : null,
543
-                                'highlight' => isset($result['highlight'])? $result['highlight'] : null,
544
-                                'elevated' => isset($result['elevated'])? $result['elevated'] : null,
542
+                                'score' => isset($result['score']) ? $result['score'] : null,
543
+                                'highlight' => isset($result['highlight']) ? $result['highlight'] : null,
544
+                                'elevated' => isset($result['elevated']) ? $result['elevated'] : null,
545 545
                                 /// @todo decide what is the correct value for 'index': guid, installation_id/guid ?
546 546
                                 //'index' => isset($result['guid'])? $result['guid'] : null,
547 547
                             ]
@@ -582,9 +582,9 @@  discard block
 block discarded – undo
582 582
                     $results[$index] = new SearchHit(
583 583
                         [
584 584
                             'valueObject' => $result,
585
-                            'score' => isset($result['score'])? $result['score'] : null,
586
-                            'highlight' => isset($result['highlight'])? $result['highlight'] : null,
587
-                            'elevated' => isset($result['elevated'])? $result['elevated'] : null,
585
+                            'score' => isset($result['score']) ? $result['score'] : null,
586
+                            'highlight' => isset($result['highlight']) ? $result['highlight'] : null,
587
+                            'elevated' => isset($result['elevated']) ? $result['elevated'] : null,
588 588
                             /// @todo decide what is the correct value for 'index': guid, installation_id/guid ?
589 589
                             //'index' => isset($result['guid'])? $result['guid'] : null,
590 590
                         ]
Please login to merge, or discard this patch.
DependencyInjection/KaliopEzFindSearchEngineExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
     protected function loadInternal(array $mergedConfig, ContainerBuilder $container)
15 15
     {
16
-        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
16
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
17 17
         $loader->load('services.yml');
18 18
 
19 19
         if (self::$loadTestConfig != false) {
Please login to merge, or discard this patch.