Completed
Push — master ( 59c7a5...1afffc )
by GBProd
02:30
created
DependencyInjection/Compiler/DataProviderCompilerPass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
     {
74 74
         if ($this->isTagIncorrect($tag)) {
75 75
             throw new \InvalidArgumentException(
76
-                sprintf('DataProvider "%s" must specify the "index"'.
76
+                sprintf('DataProvider "%s" must specify the "index"' .
77 77
                     ' and "type" attribute.', 
78 78
                     $providerId
79 79
                 )
Please login to merge, or discard this patch.
DependencyInjection/ElasticsearchDataProviderExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
         $loader = new Loader\YamlFileLoader(
26 26
             $container, 
27
-            new FileLocator(__DIR__.'/../Resources/config')
27
+            new FileLocator(__DIR__ . '/../Resources/config')
28 28
         );
29 29
         
30 30
         $loader->load('services.yml');
Please login to merge, or discard this patch.
tests/ElasticsearchDataProviderBundle/DataProvider/RegistryEntryTest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     
40 40
     public function testMatch()
41 41
     {
42
-       $testedInstance = new RegistryEntry(
42
+        $testedInstance = new RegistryEntry(
43 43
             $this->getMock(DataProviderInterface::class),
44 44
             'my_index',
45 45
             'my_type'
Please login to merge, or discard this patch.
src/ElasticsearchDataProviderBundle/DataProvider/Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     {
32 32
         $entries = $this->registry->get($index, $type);
33 33
         
34
-        foreach($entries as $entry) {
34
+        foreach ($entries as $entry) {
35 35
             $entry->getProvider()->run(
36 36
                 $client, 
37 37
                 $entry->getIndex(), 
Please login to merge, or discard this patch.
src/ElasticsearchDataProviderBundle/DataProvider/Registry.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
         return array_filter(
40 40
             $this->entries,
41
-            function ($entry) use ($index, $type) {
41
+            function($entry) use ($index, $type) {
42 42
                 return $entry->match($index, $type);
43 43
             }
44 44
         );
Please login to merge, or discard this patch.
tests/ElasticsearchDataProviderBundle/DataProvider/DataProviderTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
          ->method('populate')
70 70
          ->will(
71 71
             $this->returnCallback(
72
-               function () use ($provider) {
72
+               function() use ($provider) {
73 73
                   $provider->index(
74 74
                      'my_id', 
75 75
                      ['foo' => 'bar']
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
          ->method('populate')
103 103
          ->will(
104 104
             $this->returnCallback(
105
-               function () use ($provider) {
106
-                  for($i = 0; $i < 1500; $i++) {
105
+               function() use ($provider) {
106
+                  for ($i = 0; $i < 1500; $i++) {
107 107
                      $provider->index(
108 108
                         'my_id', 
109 109
                         ['foo' => 'bar']
Please login to merge, or discard this patch.
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -13,115 +13,115 @@
 block discarded – undo
13 13
  */
14 14
 class DataProviderTest extends \PHPUnit_Framework_TestCase
15 15
 {
16
-   public function testRunExecutePopulate()
17
-   {
18
-      $provider = $this->getMockForAbstractClass(DataProvider::class);
16
+    public function testRunExecutePopulate()
17
+    {
18
+        $provider = $this->getMockForAbstractClass(DataProvider::class);
19 19
 
20
-      $provider
21
-         ->expects($this->once())
22
-         ->method('populate')
23
-      ;
20
+        $provider
21
+            ->expects($this->once())
22
+            ->method('populate')
23
+        ;
24 24
 
25
-      $provider->run(
26
-         $this->getClient(),
27
-         'index',
28
-         'type',
29
-         $this->getMock(EventDispatcherInterface::class)
30
-      );
31
-   }
25
+        $provider->run(
26
+            $this->getClient(),
27
+            'index',
28
+            'type',
29
+            $this->getMock(EventDispatcherInterface::class)
30
+        );
31
+    }
32 32
 
33
-   /**
34
-    * @return Client
35
-    */
36
-   private function getClient()
37
-   {
38
-      return $this
39
-         ->getMockBuilder(Client::class)
40
-         ->disableOriginalConstructor()
41
-         ->getMock()
42
-      ;
43
-   }
33
+    /**
34
+     * @return Client
35
+     */
36
+    private function getClient()
37
+    {
38
+        return $this
39
+            ->getMockBuilder(Client::class)
40
+            ->disableOriginalConstructor()
41
+            ->getMock()
42
+        ;
43
+    }
44 44
 
45
-   public function testIndexWithIndexAndType()
46
-   {
47
-      $provider = $this->getMockForAbstractClass(DataProvider::class);
45
+    public function testIndexWithIndexAndType()
46
+    {
47
+        $provider = $this->getMockForAbstractClass(DataProvider::class);
48 48
 
49
-      $client = $this->getClient();
50
-      $client
51
-         ->expects($this->once())
52
-         ->method('bulk')
53
-         ->with([
49
+        $client = $this->getClient();
50
+        $client
51
+            ->expects($this->once())
52
+            ->method('bulk')
53
+            ->with([
54 54
             'body' =>
55 55
             [
56
-               [
57
-                  'index' => [
58
-                      '_index' => 'my_index',
59
-                      '_type'  => 'my_type',
60
-                      '_id'    => 'my_id',
61
-                  ]
62
-               ],
63
-               [
64
-                  'foo' => 'bar',
65
-               ]
56
+                [
57
+                    'index' => [
58
+                        '_index' => 'my_index',
59
+                        '_type'  => 'my_type',
60
+                        '_id'    => 'my_id',
61
+                    ]
62
+                ],
63
+                [
64
+                    'foo' => 'bar',
65
+                ]
66 66
             ]
67
-         ]
68
-      );
67
+            ]
68
+        );
69 69
 
70
-      $provider
71
-         ->expects($this->once())
72
-         ->method('populate')
73
-         ->will(
70
+        $provider
71
+            ->expects($this->once())
72
+            ->method('populate')
73
+            ->will(
74 74
             $this->returnCallback(
75
-               function () use ($provider) {
76
-                  $provider->index(
77
-                     'my_id',
78
-                     ['foo' => 'bar']
79
-                  );
80
-               }
75
+                function () use ($provider) {
76
+                    $provider->index(
77
+                        'my_id',
78
+                        ['foo' => 'bar']
79
+                    );
80
+                }
81 81
             )
82
-         )
83
-      ;
82
+            )
83
+        ;
84 84
 
85
-      $provider->run(
86
-         $client,
87
-         'my_index',
88
-         'my_type',
89
-         $this->getMock(EventDispatcherInterface::class)
90
-      );
91
-   }
85
+        $provider->run(
86
+            $client,
87
+            'my_index',
88
+            'my_type',
89
+            $this->getMock(EventDispatcherInterface::class)
90
+        );
91
+    }
92 92
 
93
-   public function testIndexRunBulkTwiceIfMoreThanBatchSize()
94
-   {
95
-      $provider = $this->getMockForAbstractClass(DataProvider::class);
93
+    public function testIndexRunBulkTwiceIfMoreThanBatchSize()
94
+    {
95
+        $provider = $this->getMockForAbstractClass(DataProvider::class);
96 96
 
97
-      $client = $this->getClient();
98
-      $client
99
-         ->expects($this->exactly(2))
100
-         ->method('bulk')
101
-      ;
97
+        $client = $this->getClient();
98
+        $client
99
+            ->expects($this->exactly(2))
100
+            ->method('bulk')
101
+        ;
102 102
 
103
-      $provider
104
-         ->expects($this->once())
105
-         ->method('populate')
106
-         ->will(
103
+        $provider
104
+            ->expects($this->once())
105
+            ->method('populate')
106
+            ->will(
107 107
             $this->returnCallback(
108
-               function () use ($provider) {
109
-                  for($i = 0; $i < 1500; $i++) {
110
-                     $provider->index(
108
+                function () use ($provider) {
109
+                    for($i = 0; $i < 1500; $i++) {
110
+                        $provider->index(
111 111
                         'my_id',
112 112
                         ['foo' => 'bar']
113
-                     );
114
-                  }
115
-               }
113
+                        );
114
+                    }
115
+                }
116
+            )
116 117
             )
117
-         )
118
-      ;
118
+        ;
119 119
 
120
-      $provider->run(
121
-         $client,
122
-         'my_index',
123
-         'my_type',
124
-         $this->getMock(EventDispatcherInterface::class)
125
-      );
126
-   }
120
+        $provider->run(
121
+            $client,
122
+            'my_index',
123
+            'my_type',
124
+            $this->getMock(EventDispatcherInterface::class)
125
+        );
126
+    }
127 127
 }
128 128
\ No newline at end of file
Please login to merge, or discard this patch.