Skip to content

Commit

Permalink
🤖 Automatic code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain authored and github-actions[bot] committed Jun 25, 2024
1 parent 8a9be4f commit 82d7d85
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
3 changes: 0 additions & 3 deletions Embeddings.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class Embeddings
/**
* Embeddings constructor.
*
* @param ChatInterface $chatModel
* @param EmbeddingInterface $embedModel
* @param AbstractStorage $storage
* @param array $config The plugin configuration
*/
public function __construct(
Expand Down
4 changes: 2 additions & 2 deletions Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class AbstractModel implements ModelInterface
protected $requestStart = 0;

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

/** @var DokuHTTPClient */
protected $http;
Expand Down Expand Up @@ -194,7 +194,7 @@ public function setDebug($debug = true)
* @return mixed
* @throws \Exception when the response indicates an error
*/
abstract protected function parseAPIResponse($response);
abstract protected function parseAPIResponse(mixed $response);

/**
* Send a request to the API
Expand Down
10 changes: 2 additions & 8 deletions ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

class ModelFactory
{
/** @var array The plugin configuration */
protected array $config;

public $chatModel;
public $rephraseModel;
public $embeddingModel;
Expand All @@ -19,9 +16,8 @@ class ModelFactory
/**
* @param array $config The plugin configuration
*/
public function __construct(array $config)
public function __construct(protected array $config)
{
$this->config = $config;
}

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

/**
* Set the debug flag for all models
*
* @param bool $debug
*/
public function setDebug(bool $debug = true)
{
Expand Down Expand Up @@ -122,7 +116,7 @@ public function getModels($availableOnly = false, $typeOnly = '')
try {
$info['instance'] = $this->loadModel($type, "$namespace $name");
$info['instance']->setDebug($this->debug);
} catch (\Exception $e) {
} catch (\Exception) {
if ($availableOnly) continue;
$info['instance'] = false;
}
Expand Down
3 changes: 0 additions & 3 deletions cli/simulate.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ protected function records2rows(array $result): array
/**
* Prefix each key in the given stats array to be merged with a larger array
*
* @param string $prefix
* @param array $stats
* @return array
*/
protected function flattenStats(string $prefix, array $stats)
Expand All @@ -173,7 +171,6 @@ protected function flattenStats(string $prefix, array $stats)
}

/**
* @param string $file
* @return array
* @throws Exception
*/
Expand Down
2 changes: 0 additions & 2 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function setLogger($logger)
/**
* Update the configuration
*
* @param array $config
* @return void
*/
public function updateConfig(array $config)
Expand Down Expand Up @@ -387,7 +386,6 @@ public function getLanguageLimit()
/**
* Store info about the last run
*
* @param array $data
* @return void
*/
public function setRunData(array $data)
Expand Down

0 comments on commit 82d7d85

Please sign in to comment.