Skip to content

Commit 2146d44

Browse files
splitbraingithub-actions[bot]
authored andcommitted
🤖 Automatic code style fixes
1 parent a7e0c4e commit 2146d44

File tree

7 files changed

+7
-21
lines changed

7 files changed

+7
-21
lines changed

‎Embeddings.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ class Embeddings
5050
/**
5151
* Embeddings constructor.
5252
*
53-
* @param ChatInterface $chatModel
54-
* @param EmbeddingInterface $embedModel
55-
* @param AbstractStorage $storage
5653
* @param array $config The plugin configuration
5754
*/
5855
public function __construct(

‎Model/AbstractModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ abstract class AbstractModel implements ModelInterface
3838
protected $requestStart = 0;
3939

4040
/** @var int How often to retry a request if it fails */
41-
public const MAX_RETRIES = 3;
41+
final public const MAX_RETRIES = 3;
4242

4343
/** @var DokuHTTPClient */
4444
protected $http;
@@ -194,7 +194,7 @@ public function setDebug($debug = true)
194194
* @return mixed
195195
* @throws \Exception when the response indicates an error
196196
*/
197-
abstract protected function parseAPIResponse($response);
197+
abstract protected function parseAPIResponse(mixed $response);
198198

199199
/**
200200
* Send a request to the API

‎ModelFactory.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
class ModelFactory
99
{
10-
/** @var array The plugin configuration */
11-
protected array $config;
12-
1310
public $chatModel;
1411
public $rephraseModel;
1512
public $embeddingModel;
@@ -19,9 +16,8 @@ class ModelFactory
1916
/**
2017
* @param array $config The plugin configuration
2118
*/
22-
public function __construct(array $config)
19+
public function __construct(protected array $config)
2320
{
24-
$this->config = $config;
2521
}
2622

2723
/**
@@ -39,8 +35,6 @@ public function updateConfig(array $config)
3935

4036
/**
4137
* Set the debug flag for all models
42-
*
43-
* @param bool $debug
4438
*/
4539
public function setDebug(bool $debug = true)
4640
{
@@ -122,7 +116,7 @@ public function getModels($availableOnly = false, $typeOnly = '')
122116
try {
123117
$info['instance'] = $this->loadModel($type, "$namespace $name");
124118
$info['instance']->setDebug($this->debug);
125-
} catch (\Exception $e) {
119+
} catch (\Exception) {
126120
if ($availableOnly) continue;
127121
$info['instance'] = false;
128122
}

‎Storage/PineconeStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function deletePageChunks($page, $firstChunkID)
124124
$this->runQuery('/vectors/delete', ['ids' => $ids]);
125125
} catch (\Exception $e) {
126126
// 5 is the code for "namespace not found" See #12
127-
if($e->getCode() !== 5) throw $e;
127+
if ($e->getCode() !== 5) throw $e;
128128
}
129129
}
130130

‎cli.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,10 @@ protected function createEmbeddings($clear)
357357
$data = $this->helper->getRunData();
358358
$lastEmbedModel = $data['embed used'] ?? '';
359359

360-
if(
360+
if (
361361
!$clear && $lastEmbedModel &&
362362
$lastEmbedModel != (string) $this->helper->getEmbeddingModel()
363-
){
363+
) {
364364
$this->warning('Embedding model has changed since last run. Forcing an index rebuild');
365365
$clear = true;
366366
}

‎cli/simulate.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ protected function records2rows(array $result): array
159159
/**
160160
* Prefix each key in the given stats array to be merged with a larger array
161161
*
162-
* @param string $prefix
163-
* @param array $stats
164162
* @return array
165163
*/
166164
protected function flattenStats(string $prefix, array $stats)
@@ -173,7 +171,6 @@ protected function flattenStats(string $prefix, array $stats)
173171
}
174172

175173
/**
176-
* @param string $file
177174
* @return array
178175
* @throws Exception
179176
*/

‎helper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function setLogger($logger)
5959
/**
6060
* Update the configuration
6161
*
62-
* @param array $config
6362
* @return void
6463
*/
6564
public function updateConfig(array $config)
@@ -387,7 +386,6 @@ public function getLanguageLimit()
387386
/**
388387
* Store info about the last run
389388
*
390-
* @param array $data
391389
* @return void
392390
*/
393391
public function setRunData(array $data)

0 commit comments

Comments
 (0)