Your project uses non-strict array lookups 2

More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup

  1. if ($intent === null || !is_array($intent)) {
  2. return null;
  3. }
  4. // Validate required fields
  5. if (!isset($intent['intent']) || !in_array($intent['intent'], ['comparative_lookup', 'entity_discovery', 'market_research', 'trend_analysis'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return null;
  7. }
  8. // Ensure all fields exist with defaults
  9. $validatedIntent = [
  1. 'open-mistral-nemo',
  2. 'open-codestral-mamba',
  3. 'mistral-moderation-latest'
  4. ];
  5. if (empty($model) || !in_array($model, $valid_models)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $model = 'mistral-large-latest';
  7. }
  8. $config = new MistralAIConfig();
  9. $config->apiKey = $api_key;

Your project uses legacy callable syntax instead of first-class callable syntax 3

More information: https://insight.symfony.com/what-we-analyse/php.use_first_class_callable_syntax

  1. */
  2. private function deriveNameFromTable(string $tableName): string
  3. {
  4. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  5. return str_replace([$prefix, '_embedding'], '', $tableName);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. /**
  8. * Classify every known table as entity / satellite / system
  9. *
  1. {
  2. self::$queue[] = ['task' => $task, 'label' => $label];
  3. if (!self::$registered) {
  4. self::$registered = true;
  5. register_shutdown_function([self::class, 'flushAndRun']);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. }
  8. /**
  9. * Shutdown handler: flush the response to the client (PHP-FPM), then drain the queue.
  1. substr($result, 0, 100)
  2. ));
  3. }
  4. // Extract usage metrics.
  5. $lastResponse = is_callable([$chat, 'getLastResponse']) ? $chat->getLastResponse() : null;
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if (!is_null($lastResponse) && isset($lastResponse['usage'])) {
  7. self::$lastTokenUsage = [
  8. 'prompt_tokens' => $lastResponse['usage']['prompt_tokens'] ?? 0,
  9. 'completion_tokens' => $lastResponse['usage']['completion_tokens'] ?? 0,