Completed
Branch master (ffc11c)
by Gaetano
16:51
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/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.
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.
Persistence/eZFind/Content/Search/Common/Gateway/FacetHandler/DateRange.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -88,29 +88,29 @@
 block discarded – undo
88 88
      */
89 89
     protected function convertDateInterval(DateInterval $dateInterval)
90 90
     {
91
-        $sign = $dateInterval->invert? '-' : '+';
91
+        $sign = $dateInterval->invert ? '-' : '+';
92 92
         if ($dateInterval->days) {
93
-            return $sign . $dateInterval->days . 'DAY' . (($dateInterval->y > 1)? 'S' : '');
93
+            return $sign . $dateInterval->days . 'DAY' . (($dateInterval->y > 1) ? 'S' : '');
94 94
         }
95 95
 
96 96
         $syntax = '';
97 97
         if ($dateInterval->y) {
98
-            $syntax .= $sign . $dateInterval->y . 'YEAR' . (($dateInterval->y > 1)? 'S' : '');
98
+            $syntax .= $sign . $dateInterval->y . 'YEAR' . (($dateInterval->y > 1) ? 'S' : '');
99 99
         }
100 100
         if ($dateInterval->m) {
101
-            $syntax .= $sign . $dateInterval->m . 'MONTH' . (($dateInterval->m > 1)? 'S' : '');
101
+            $syntax .= $sign . $dateInterval->m . 'MONTH' . (($dateInterval->m > 1) ? 'S' : '');
102 102
         }
103 103
         if ($dateInterval->d) {
104
-            $syntax .= $sign . $dateInterval->d . 'DAY' . (($dateInterval->d > 1)? 'S' : '');
104
+            $syntax .= $sign . $dateInterval->d . 'DAY' . (($dateInterval->d > 1) ? 'S' : '');
105 105
         }
106 106
         if ($dateInterval->h) {
107
-            $syntax .= $sign . $dateInterval->h . 'HOUR' . (($dateInterval->h > 1)? 'S' : '');
107
+            $syntax .= $sign . $dateInterval->h . 'HOUR' . (($dateInterval->h > 1) ? 'S' : '');
108 108
         }
109 109
         if ($dateInterval->i) {
110
-            $syntax .= $sign . $dateInterval->i . 'MINUTE' . (($dateInterval->i > 1)? 'S' : '');
110
+            $syntax .= $sign . $dateInterval->i . 'MINUTE' . (($dateInterval->i > 1) ? 'S' : '');
111 111
         }
112 112
         if ($dateInterval->s) {
113
-            $syntax .= $sign . $dateInterval->s . 'SECOND' . (($dateInterval->s > 1)? 'S' : '');
113
+            $syntax .= $sign . $dateInterval->s . 'SECOND' . (($dateInterval->s > 1) ? 'S' : '');
114 114
         }
115 115
 
116 116
         return $syntax;
Please login to merge, or discard this patch.
Persistence/eZFind/Content/Search/Common/Gateway/FacetHandler/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     {
39 39
         $facetKey = $this->getFacetKey($facetBuilder);
40 40
         $fieldNames = [];
41
-        foreach ((array) $facetBuilder->fieldPaths as $fieldPath) {
41
+        foreach ((array)$facetBuilder->fieldPaths as $fieldPath) {
42 42
             $fieldNames[] = \eZSolr::getFieldName($fieldPath, false, 'facet');
43 43
         }
44 44
 
Please login to merge, or discard this patch.
eZFind/Content/Search/Common/Gateway/CriterionHandler/LocationPriority.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,29 +8,29 @@
 block discarded – undo
8 8
 
9 9
 class LocationPriority extends CriterionHandler
10 10
 {
11
-    public function accept( Criterion $criterion )
11
+    public function accept(Criterion $criterion)
12 12
     {
13 13
         return $criterion instanceof Criterion\LocationPriority;
14 14
     }
15 15
 
16
-    public function handle( CriteriaConverter $converter, Criterion $criterion )
16
+    public function handle(CriteriaConverter $converter, Criterion $criterion)
17 17
     {
18
-        switch ( $criterion->operator )
18
+        switch ($criterion->operator)
19 19
         {
20 20
             case Criterion\Operator::BETWEEN:
21 21
                 return 'priority:[' . $this->escapeValue($criterion->value[0]) . ' TO ' . $this->escapeValue($criterion->value[1]) . ']';
22 22
 
23 23
             case Criterion\Operator::GT:
24
-                return 'priority:{' . $this->escapeValue(reset( $criterion->value )) . ' TO *]';
24
+                return 'priority:{' . $this->escapeValue(reset($criterion->value)) . ' TO *]';
25 25
 
26 26
             case Criterion\Operator::GTE:
27
-                return 'priority:[' . $this->escapeValue(reset( $criterion->value )) . ' TO *]';
27
+                return 'priority:[' . $this->escapeValue(reset($criterion->value)) . ' TO *]';
28 28
 
29 29
             case Criterion\Operator::LT:
30
-                return 'priority:[* TO ' . $this->escapeValue(reset( $criterion->value )) . '}';
30
+                return 'priority:[* TO ' . $this->escapeValue(reset($criterion->value)) . '}';
31 31
 
32 32
             case Criterion\Operator::LTE:
33
-                return 'priority:[* TO ' . $this->escapeValue(reset( $criterion->value )) . ']';
33
+                return 'priority:[* TO ' . $this->escapeValue(reset($criterion->value)) . ']';
34 34
 
35 35
         }
36 36
     }
Please login to merge, or discard this patch.