Your project uses non-strict array lookups 2
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- if ($intent === null || !is_array($intent)) {
- return null;
- }
- // Validate required fields
- if (!isset($intent['intent']) || !in_array($intent['intent'], ['comparative_lookup', 'entity_discovery', 'market_research', 'trend_analysis'])) {
- return null;
- }
- // Ensure all fields exist with defaults
- $validatedIntent = [
- 'open-mistral-nemo',
- 'open-codestral-mamba',
- 'mistral-moderation-latest'
- ];
- if (empty($model) || !in_array($model, $valid_models)) {
- $model = 'mistral-large-latest';
- }
- $config = new MistralAIConfig();
- $config->apiKey = $api_key;
Your project uses legacy callable syntax instead of first-class callable syntax 3
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.use_first_class_callable_syntax
- */
- private function deriveNameFromTable(string $tableName): string
- {
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- return str_replace([$prefix, '_embedding'], '', $tableName);
- }
- /**
- * Classify every known table as entity / satellite / system
- *
- {
- self::$queue[] = ['task' => $task, 'label' => $label];
- if (!self::$registered) {
- self::$registered = true;
- register_shutdown_function([self::class, 'flushAndRun']);
- }
- }
- /**
- * Shutdown handler: flush the response to the client (PHP-FPM), then drain the queue.
- substr($result, 0, 100)
- ));
- }
- // Extract usage metrics.
- $lastResponse = is_callable([$chat, 'getLastResponse']) ? $chat->getLastResponse() : null;
- if (!is_null($lastResponse) && isset($lastResponse['usage'])) {
- self::$lastTokenUsage = [
- 'prompt_tokens' => $lastResponse['usage']['prompt_tokens'] ?? 0,
- 'completion_tokens' => $lastResponse['usage']['completion_tokens'] ?? 0,