Completed
Push — master ( 26e407...24bafe )
by Juuso
04:14
created
src/AlgoliaFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function makeSearchableObject($className)
32 32
     {
33
-        if (! (new \ReflectionClass($className))->implementsInterface(SearchableInterface::class)) {
33
+        if ( ! (new \ReflectionClass($className))->implementsInterface(SearchableInterface::class)) {
34 34
             throw new \InvalidArgumentException("Cannot initiate a class ({$className}) which doesn't implement leinonen\\Yii2Algolia\\SearchableInterface");
35 35
         }
36 36
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     protected function getConfig(array $config)
62 62
     {
63
-        if (! array_key_exists('applicationId', $config) || ! array_key_exists('apiKey', $config)) {
63
+        if ( ! array_key_exists('applicationId', $config) || ! array_key_exists('apiKey', $config)) {
64 64
             throw new InvalidArgumentException('Configuration keys applicationId and apiKey are required');
65 65
         }
66 66
 
Please login to merge, or discard this patch.
src/AlgoliaManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         }
249 249
 
250 250
         foreach ($indices as $index) {
251
-            $temporaryIndexName = 'tmp_' . $index->indexName;
251
+            $temporaryIndexName = 'tmp_'.$index->indexName;
252 252
 
253 253
             /** @var Index $temporaryIndex */
254 254
             $temporaryIndex = $this->initIndex($temporaryIndexName);
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
     {
313 313
         $reflectionClass = new \ReflectionClass($class);
314 314
 
315
-        if (! $reflectionClass->implementsInterface(SearchableInterface::class)) {
315
+        if ( ! $reflectionClass->implementsInterface(SearchableInterface::class)) {
316 316
             throw new \InvalidArgumentException("The class: {$reflectionClass->name} doesn't implement leinonen\\Yii2Algolia\\SearchableInterface");
317 317
         }
318 318
     }
@@ -342,10 +342,10 @@  discard block
 block discarded – undo
342 342
     {
343 343
         $indexNames = $searchableModel->getIndices();
344 344
 
345
-        $indices = array_map(function($indexName){
345
+        $indices = array_map(function($indexName) {
346 346
 
347
-            if($this->env !== null){
348
-                $indexName = $this->env . '_' . $indexName;
347
+            if ($this->env !== null) {
348
+                $indexName = $this->env.'_'.$indexName;
349 349
             }
350 350
 
351 351
             return $this->initIndex($indexName);
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
         $arrayType = $this->getClassName($searchableModels[0]);
370 370
         $indices = $this->initIndices($this->factory->makeSearchableObject($arrayType));
371 371
 
372
-        $algoliaRecords = array_map(function ($searchableModel) use ($arrayType) {
372
+        $algoliaRecords = array_map(function($searchableModel) use ($arrayType) {
373 373
             /** @var $searchableModel SearchableInterface */
374
-            if (!$searchableModel instanceof $arrayType) {
374
+            if ( ! $searchableModel instanceof $arrayType) {
375 375
                 throw new \InvalidArgumentException("The given array should not contain multiple different classes");
376 376
             }
377 377
 
Please login to merge, or discard this patch.