@@ -205,7 +205,7 @@ |
||
205 | 205 | /** |
206 | 206 | * Checks if the given class implements SearchableInterface. |
207 | 207 | * |
208 | - * @param mixed $class Either name or instance of the class to be checked. |
|
208 | + * @param string $class Either name or instance of the class to be checked. |
|
209 | 209 | */ |
210 | 210 | private function checkImplementsSearchableInterface($class) |
211 | 211 | { |
@@ -191,7 +191,6 @@ |
||
191 | 191 | |
192 | 192 | /** |
193 | 193 | * Dynamically pass methods to the Algolia Client. |
194 | - |
|
195 | 194 | * @param string $method |
196 | 195 | * @param array $parameters |
197 | 196 | * |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | foreach ($indices as $index) { |
164 | - $temporaryIndexName = 'tmp_' . $index; |
|
164 | + $temporaryIndexName = 'tmp_'.$index; |
|
165 | 165 | |
166 | 166 | /** @var Index $temporaryIndex */ |
167 | 167 | $temporaryIndex = $this->initIndex($temporaryIndexName); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $reflectionClass = new \ReflectionClass($class); |
213 | 213 | |
214 | - if (! $reflectionClass->implementsInterface(SearchableInterface::class)) { |
|
214 | + if ( ! $reflectionClass->implementsInterface(SearchableInterface::class)) { |
|
215 | 215 | throw new \InvalidArgumentException("The class: {$reflectionClass->getName()} doesn't implement leinonen\\Yii2Algolia\\SearchableInterface"); |
216 | 216 | } |
217 | 217 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | public function bootstrap($app) |
44 | 44 | { |
45 | 45 | Yii::$container->set(AlgoliaManager::class, function () { |
46 | - return $this->createManager(); |
|
46 | + return $this->createManager(); |
|
47 | 47 | }); |
48 | 48 | } |
49 | 49 |
@@ -42,7 +42,7 @@ |
||
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 | } |
@@ -37,21 +37,21 @@ |
||
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); |
@@ -15,7 +15,7 @@ |
||
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 |
@@ -44,7 +44,7 @@ |
||
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 |