Your project uses non-strict array lookups 5

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

  1. exit;
  2. }
  3. // Validate feedback_type
  4. $validTypes = ['positive', 'negative', 'correction'];
  5. if (!in_array($input['feedback_type'], $validTypes)) {
    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. echo json_encode([
  7. 'success' => false,
  8. 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
  9. ]);
  10. exit;
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_COMPLIANCE_POLICY_RULES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() 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. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_COMPLIANCE_POLICY_RULES_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_COMPLIANCE_POLICY_RULES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() 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. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_COMPLIANCE_POLICY_RULES_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_COMPLIANCE_POLICY_RULES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() 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. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_COMPLIANCE_POLICY_RULES_INSTALLED', implode(';', $installed));
  1. $Qcheck = $CLICSHOPPING_Db->get('configuration', 'configuration_value', ['configuration_key' => 'TEMPLATE_BLOCK_GROUPS']);
  2. if ($Qcheck->fetch() !== false) {
  3. $tbgroups_array = explode(';', $Qcheck->value('configuration_value'));
  4. if (!\in_array($module_type, $tbgroups_array)) {
    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
  5. $tbgroups_array[] = $module_type;
  6. sort($tbgroups_array);
  7. $CLICSHOPPING_Db->save('configuration', [
  8. 'configuration_value' => implode(';', $tbgroups_array),

Your project should not contain PHP files defining multiple classes

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

This file contains 2 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.
Time to fix: about 4 hours
Read doc Open Issue Permalink Copy Prompt
Collective
  • he_header_multi_template (defined at line 14)
  • explodeCategoryTree (defined at line 230)

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

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. 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,