Your project uses non-strict array lookups 3
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- foreach ($models as $model) {
- $modelId = $model['id'];
- $provider = $model['provider'] ?? 'openai'; // Default to openai if missing
- // Validate provider name
- if (!in_array($provider, $validProviders)) {
- if (defined('CLICSHOPPING_APP_CHATGPT_CH_DEBUG') && CLICSHOPPING_APP_CHATGPT_CH_DEBUG === 'True') {
- error_log("WARNING: Invalid provider '$provider' for model '$modelId'. Using 'openai' as default.");
- }
- $provider = 'openai';
- }
- 'open-mistral-nemo',
- 'open-codestral-mamba',
- 'mistral-moderation-latest'
- ];
- if (empty($model) || !in_array($model, $valid_models)) {
- $model = 'mistral-large-latest';
- }
- $config = new MistralAIChat();
- $config->apiKey = $api_key;
- if ($intent === null || !is_array($intent)) {
- return null;
- }
- // Validate required fields
- if (!isset($intent['intent']) || !in_array($intent['intent'], ['price_comparison', 'product_discovery', 'market_research', 'trend_analysis'])) {
- return null;
- }
- // Ensure all fields exist with defaults
- $validatedIntent = [
Your project uses legacy callable syntax instead of first-class callable syntax 2
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.use_first_class_callable_syntax
- }
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- // Remove prefix and '_embedding' suffix to get entity type
- $entityType = str_replace([$prefix, '_embedding'], '', $tableName);
- // Get ID column for this entity type
- $idColumn = $this->getIdColumnForEntityType($entityType);
- // Cache the result
- public function getEntityTypeForTable(string $tableName): string
- {
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- // Remove prefix and '_embedding' suffix
- $entityType = str_replace([$prefix, '_embedding'], '', $tableName);
- return $entityType;
- }
- /**
gyakutsuki
gyakutsuki
gyakutsuki
gyakutsuki
gyakutsuki