Completed
Push — master ( ffcb18...26e407 )
by Juuso
03:41
created
src/AlgoliaComponent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function bootstrap($app)
44 44
     {
45
-        Yii::$container->set(AlgoliaManager::class, function () {
45
+        Yii::$container->set(AlgoliaManager::class, function() {
46 46
              return $this->createManager();
47 47
         });
48 48
     }
Please login to merge, or discard this patch.
src/ActiveRecord/SynchronousAutoIndexBehavior.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,21 +37,21 @@
 block discarded – undo
37 37
     public function events()
38 38
     {
39 39
         return [
40
-            ActiveRecord::EVENT_AFTER_INSERT => function (Event $event) {
40
+            ActiveRecord::EVENT_AFTER_INSERT => function(Event $event) {
41 41
                 if ($this->afterInsert) {
42 42
                     /** @var $manager AlgoliaManager */
43 43
                     $manager = Yii::$container->get(AlgoliaManager::class);
44 44
                     $manager->pushToIndices($event->sender);
45 45
                 }
46 46
             },
47
-            ActiveRecord::EVENT_AFTER_DELETE => function (Event $event) {
47
+            ActiveRecord::EVENT_AFTER_DELETE => function(Event $event) {
48 48
                 if ($this->afterDelete) {
49 49
                     /** @var $manager AlgoliaManager */
50 50
                     $manager = Yii::$container->get(AlgoliaManager::class);
51 51
                     $manager->removeFromIndices($event->sender);
52 52
                 }
53 53
             },
54
-            ActiveRecord::EVENT_AFTER_UPDATE => function (Event $event) {
54
+            ActiveRecord::EVENT_AFTER_UPDATE => function(Event $event) {
55 55
                 if ($this->afterUpdate) {
56 56
                     /** @var $manager AlgoliaManager */
57 57
                     $manager = Yii::$container->get(AlgoliaManager::class);
Please login to merge, or discard this patch.
src/ActiveRecord/ActiveRecordFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function make($className)
17 17
     {
18
-        if (! (new \ReflectionClass($className))->implementsInterface(ActiveRecordInterface::class)) {
18
+        if ( ! (new \ReflectionClass($className))->implementsInterface(ActiveRecordInterface::class)) {
19 19
             throw new \InvalidArgumentException("Cannot initiate a class ({$className}) which doesn't implement \\yii\\db\\ActiveRecordInterface");
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/AlgoliaFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
      */
45 45
     protected function getConfig(array $config)
46 46
     {
47
-        if (! array_key_exists('applicationId', $config) || ! array_key_exists('apiKey', $config)) {
47
+        if ( ! array_key_exists('applicationId', $config) || ! array_key_exists('apiKey', $config)) {
48 48
             throw new InvalidArgumentException('Configuration keys applicationId and apiKey are required');
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/AlgoliaManager.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         }
209 209
 
210 210
         foreach ($indices as $index) {
211
-            $temporaryIndexName = 'tmp_' . $index->indexName;
211
+            $temporaryIndexName = 'tmp_'.$index->indexName;
212 212
 
213 213
             /** @var Index $temporaryIndex */
214 214
             $temporaryIndex = $this->initIndex($temporaryIndexName);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     {
273 273
         $reflectionClass = new \ReflectionClass($class);
274 274
 
275
-        if (! $reflectionClass->implementsInterface(SearchableInterface::class)) {
275
+        if ( ! $reflectionClass->implementsInterface(SearchableInterface::class)) {
276 276
             throw new \InvalidArgumentException("The class: {$reflectionClass->name} doesn't implement leinonen\\Yii2Algolia\\SearchableInterface");
277 277
         }
278 278
     }
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
         $indices = [];
292 292
 
293 293
         foreach ($indexNames as $indexName) {
294
-            if($this->env !== null){
295
-                $indexName = $this->env . '_' . $indexName;
294
+            if ($this->env !== null) {
295
+                $indexName = $this->env.'_'.$indexName;
296 296
             }
297 297
 
298 298
             $indices[] = $this->initIndex($indexName);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -291,7 +291,7 @@
 block discarded – undo
291 291
         $indices = [];
292 292
 
293 293
         foreach ($indexNames as $indexName) {
294
-            if($this->env !== null){
294
+            if($this->env !== null) {
295 295
                 $indexName = $this->env . '_' . $indexName;
296 296
             }
297 297
 
Please login to merge, or discard this patch.