Your project uses non-strict array lookups 9
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- ];
- // Validate mode_hint if present
- if ($validatedIntent['mode_hint'] !== null) {
- $validModeHints = ['mode_a', 'mode_b', 'mode_c', 'hybrid'];
- if (!in_array($validatedIntent['mode_hint'], $validModeHints)) {
- $validatedIntent['mode_hint'] = null;
- }
- }
- // Normalize target_site to lowercase
- 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 = [
- exit;
- }
- // Validate feedback_type
- $validTypes = ['positive', 'negative', 'correction'];
- if (!in_array($input['feedback_type'], $validTypes)) {
- echo json_encode([
- 'success' => false,
- 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
- ]);
- exit;
- $Qcheck = $CLICSHOPPING_Db->get('configuration', 'configuration_value', ['configuration_key' => 'TEMPLATE_BLOCK_GROUPS']);
- if ($Qcheck->fetch() !== false) {
- $tbgroups_array = explode(';', $Qcheck->value('configuration_value'));
- if (!\in_array($module_type, $tbgroups_array)) {
- $tbgroups_array[] = $module_type;
- sort($tbgroups_array);
- $CLICSHOPPING_Db->save('configuration', [
- 'configuration_value' => implode(';', $tbgroups_array),
- // Extract totals from the order totals array
- $ht = $tva = $ttc = 0.0;
- foreach ($totals as $t) {
- $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
- $c = $t['class'] ?? '';
- if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
- if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
- if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
- }
- // Fallback: compute HT from product lines if ot_subtotal not found
- foreach ($totals as $t) {
- $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
- $c = $t['class'] ?? '';
- if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
- if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
- if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
- }
- // Fallback: compute HT from product lines if ot_subtotal not found
- if ($ht == 0.0) {
- foreach ($products as $p) {
- $ht = $tva = $ttc = 0.0;
- foreach ($totals as $t) {
- $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
- $c = $t['class'] ?? '';
- if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
- if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
- if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
- }
- // Fallback: compute HT from product lines if ot_subtotal not found
- if ($ht == 0.0) {
- * @return void
- */
- public static function render(string $type, \FPDF $pdf, object $order, array $extra): void
- {
- // Validate type
- if (!in_array($type, ['invoice', 'packingslip'])) {
- throw new InvalidArgumentException('Invalid PDF type. Must be "invoice" or "packingslip".');
- }
- // Include the renderer class if not already loaded
- if (!class_exists('PDF_Invoice')) {
- '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 should not contain PHP files defining multiple classes
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.file_contains_more_than_one_class
Your project uses legacy callable syntax instead of first-class callable syntax
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.use_first_class_callable_syntax
- {
- 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.
gyakutsuki
gyakutsuki
gyakutsuki