Your project should only use iterable types in foreach loops 35
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_foreach_iterable
- if (!$whitelistMatch) {
- return false;
- }
- // Check if query contains any blacklisted pattern
- foreach ($this->queryBlacklist as $pattern) {
- if (preg_match($pattern, $query)) {
- return false;
- }
- }
- */
- private function validateQueryPatterns(string $query): bool
- {
- // Check if query matches any whitelist pattern
- $whitelistMatch = false;
- foreach ($this->queryWhitelist as $pattern) {
- if (preg_match($pattern, $query)) {
- $whitelistMatch = true;
- break;
- }
- }
- public function execute()
- {
- $page = (isset($_GET['page']) && is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
- if (isset($_POST['selected'])) {
- foreach ($_POST['selected'] as $id) {
- $Qupdate = $this->app->db->prepare('update :table_countries
- set status = 0
- where countries_id = :countries_id
- ');
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- public function clearCache(): bool
- {
- $files = glob($this->cacheDir . '*.json');
- $success = true;
- foreach ($files as $file) {
- if (!@unlink($file)) {
- $success = false;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- if ($this->debug == 'True') {
- $this->securityLogger->logSecurityEvent("Results found in table {$tableName}: " . count($results), 'info');
- }
- // Ajouter les résultats à la liste complète
- foreach ($results as $document) {
- $allResults[] = $document;
- }
- } catch (\Exception $e) {
- if ($this->debug == 'True') {
- $this->securityLogger->logSecurityEvent("Error while searching in table {$tableName}: " . $e->getMessage(), 'error');
- // Ajuster pour gérer plusieurs jeux de résultats
- if (isset($results['multi_query_results'])) {
- $allResults = [];
- foreach ($results['multi_query_results'] as $queryBlock) {
- foreach ($queryBlock['results'] as $item) {
- $allResults[] = $item;
- }
- }
- $interpretation = $this->interpretResults($question, $allResults);
- } else {
- $query->execute();
- $tables = $query->fetchAll(\PDO::FETCH_COLUMN);
- $this->databaseSchema = [];
- foreach ($tables as $table) {
- // Validate table name
- $safeTable = InputValidator::sanitizeIdentifier($table);
- if ($safeTable !== $table) {
- $this->securityLogger->logSecurityEvent(
- $query = $this->db->prepare("SHOW TABLES");
- $query->execute();
- $tables = $query->fetchAll(\PDO::FETCH_COLUMN);
- // For each table, analyze the columns to detect potential relationships
- foreach ($tables as $table) {
- // Validate table name
- $safeTable = InputValidator::sanitizeIdentifier($table);
- if ($safeTable !== $table) {
- $this->securityLogger->logSecurityEvent(
- "Suspicious table name sanitized: {$table} -> {$safeTable}",
- $query = $this->db->prepare("DESCRIBE " . $table);
- $query->execute();
- $columns = $query->fetchAll(\PDO::FETCH_ASSOC);
- $schema = [];
- foreach ($columns as $column) {
- $schema[$column['Field']] = $column['Type'];
- }
- // Cache the schema
- $this->tableSchemaCache[$table] = $schema;
- $columnsQuery->execute();
- $columns = $columnsQuery->fetchAll(\PDO::FETCH_ASSOC);
- $this->databaseSchema[$table] = [];
- foreach ($columns as $column) {
- $this->databaseSchema[$table][$column['Field']] = [
- 'type' => $column['Type'],
- 'null' => $column['Null'],
- 'key' => $column['Key'],
- 'default' => $column['Default'],
- $stmt = $this->db->prepare('EXPLAIN ' . $sql);
- $stmt->execute();
- $plan = $stmt->fetchAll(\PDO::FETCH_ASSOC);
- $this->securityLogger->logSecurityEvent("EXPLAIN PLAN for SQL:\n" . $sql, 'info');
- foreach ($plan as $row) {
- $this->securityLogger->logSecurityEvent(print_r($row, true), 'info');
- }
- } catch (\Exception $e) {
- $this->securityLogger->logSecurityEvent("Failed to EXPLAIN query: " . $e->getMessage(), 'error');
- }
- }
- // Ajuster pour gérer plusieurs jeux de résultats
- if (isset($results['multi_query_results'])) {
- $allResults = [];
- foreach ($results['multi_query_results'] as $queryBlock) {
- foreach ($queryBlock['results'] as $item) {
- $allResults[] = $item;
- }
- }
- $interpretation = $this->interpretResults($question, $allResults);
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $CLICSHOPPING_Hooks = Registry::get('Hooks');
- $page = (isset($_GET['page']) && is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
- if (!\is_null($_POST['selected'])) {
- foreach ($_POST['selected'] as $id) {
- if ($id != 3) {
- if ($id != 4) {
- if ($id != 5) {
- $CLICSHOPPING_PageManager->db->delete('pages_manager', ['pages_id' => (int)$id]);
- $CLICSHOPPING_PageManager->db->delete('pages_manager_description', ['pages_id' => (int)$id]);
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- *
- * @param int $now Current timestamp
- */
- private function cleanupStorage(int $now): void
- {
- foreach ($this->storage as $key => $data) {
- if (isset($data['first_request']) && $data['first_request'] < ($now - ($this->timeWindow * 2))) {
- unset($this->storage[$key]);
- }
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $rows = "<tbody>";
- foreach ($data as $row) {
- $rows .= "<tr>";
- foreach ($row as $key => $value) {
- if (!is_numeric($key)) {
- $value = HTMLOverrideCommon::removeInvisibleCharacters($value);
- $rows .= "<td>" . htmlspecialchars(Hash::displayDecryptedDataText($value)) . "</td>";
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
- $embeddedDocuments = NewVector::createEmbedding(null, $embedding_data);
- $embeddings = [];
- foreach ($embeddedDocuments as $embeddedDocument) {
- if (is_array($embeddedDocument->embedding)) {
- $embeddings[] = $embeddedDocument->embedding;
- }
- }
Your project should not contain unused code 42
- Read doc
- Productivity
- Minor
More information: https://insight.symfony.com/what-we-analyse/php.unused_local_variable_or_private_member
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_countries']);
- }
- }
- private static function removeProductsCountriesDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_countries"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_communication_newsletter']);
- }
- }
- private static function removeDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_newsletters"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_report_stats_customers']);
- }
- }
- private static function removeDataDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_customers"');
- class LlmGuardrails
- {
- private const CONFIDENCE_THRESHOLD = 0.75;
- private const HALLUCINATION_THRESHOLD = 0.8; // a implementer
- private const MAX_RESPONSE_LENGTH = 8192;
- private const MIN_CONFIDENCE_SCORE = 0.6; // a implementer
- protected static ?SecurityLogger $securityLogger = null;
- // Patterns de détection d'hallucinations e-commerce
- //possible to create a specific suspicious pattern
- private const SUSPICIOUS_PATTERNS = [];
- * Returns a float score between 0.0 and 1.0 based on the number of citations.
- *
- * @param string $result The AI-generated response to validate.
- * @return float Attribution score (0.0 to 1.0).
- */
- private static function validateAttribution(string $result): float
- {
- $citations = substr_count($result, 'source:') + substr_count($result, '(voir') + preg_match_all('/\[.*?\]/', $result);
- if ($citations === 0) return 0.0;
- */
- #[AllowDynamicProperties]
- class LlmGuardrails
- {
- private const CONFIDENCE_THRESHOLD = 0.75;
- private const HALLUCINATION_THRESHOLD = 0.8; // a implementer
- private const MAX_RESPONSE_LENGTH = 8192;
- private const MIN_CONFIDENCE_SCORE = 0.6; // a implementer
- protected static ?SecurityLogger $securityLogger = null;
- // Patterns de détection d'hallucinations e-commerce
- */
- private function createEmbeddingGenerator(): EmbeddingGeneratorInterface
- {
- return new class(Gpt::class) implements EmbeddingGeneratorInterface
- {
- private $gptClass;
- /**
- * Constructor for the embedding generator
- *
- * @param string $gptClass Class name of the Gpt instance
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_customers_reviews']);
- }
- }
- private static function removeDataDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_reviews"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_catalog_categories']);
- }
- }
- private static function removeDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_categories"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_tax_geo_zones']);
- }
- }
- private static function removeProductsTaxGeoZonesDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_geo_zones"');
- *
- * @param string $sqlQuery Original SQL query containing unknown column
- * @param string $unknownColumn Name of the unknown column to correct
- * @return string Corrected SQL query or original if no correction possible
- */
- private function correctUnknownColumn(string $sqlQuery, string $unknownColumn): string {
- // Check if the column contains a dot (alias.column)
- if (strpos($unknownColumn, '.') !== false) {
- list($alias, $column) = explode('.', $unknownColumn);
- // Look for a similar column in the schema's tables
- {
- private mixed $chat;
- private mixed $db;
- private int $languageId;
- private array $tableSchemaCache = [];
- private array $tableRelationships = [];
- private array $columnSynonyms = [];
- private array $correctionLog = [];
- private array $databaseSchema = [];
- private array $columnIndex = [];
- private mixed $cache;
- * - Unresolved placeholders
- *
- * @param string $sqlQuery SQL query to validate
- * @return array Validation results with 'is_valid' boolean and array of 'issues'
- */
- private function validateSqlSyntax(string $sqlQuery): array {
- $issues = [];
- // Check the balance of parentheses
- $openParenCount = substr_count($sqlQuery, '(');
- $closeParenCount = substr_count($sqlQuery, ')');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_settings']);
- }
- }
- private static function removeProductsSettingsDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_settings"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_administrators']);
- }
- }
- private static function removeProductsAdministratorsDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_administrators"');
- }
- /**
- *
- */
- private static function removeProductsRecommendationsDb(): void
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_products_recommendations"');
- $CLICSHOPPING_Db->delete('actions_recorder', ['app_code' => 'app_tools_actions_recorder']);
- }
- }
- private static function removeProductsActionsRecorderDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_actions_recorder"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_modules']);
- }
- }
- private static function removeProductsModulesDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_currencies"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_tax_rates']);
- }
- }
- private static function removeProductsTaxRatesDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_tax_rates"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_products_length']);
- }
- }
- private static function removeProductsProductsLengthDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_products_length"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_products_quantity_unit']);
- }
- }
- private static function removeProductsProductsQuantityUnitDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_products_quantity_unit"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_tax_class']);
- }
- }
- private static function removeProductsTaxClassDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_tax_class"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_orders_status']);
- }
- }
- private static function removeProductsOrdersStatusDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_orders_status"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_marketing_featured']);
- }
- }
- private static function removeProductsFeaturedDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_products_featured"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_tools_define_language']);
- }
- }
- private static function removeProductsDefineLanguageDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_currencies"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_zones']);
- }
- }
- private static function removeProductsZonesDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_zones"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_marketing_seo']);
- }
- }
- private static function removeDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_seo"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_currency']);
- }
- }
- private static function removeProductsCurrencyDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_currencies"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_marketing_favorites']);
- }
- }
- private static function removeProductsFavoritesDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_products_favorites"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_marketing_specials']);
- }
- }
- private static function removeProductsSpecialsDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_specials"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_cache']);
- }
- }
- private static function removeProductsCacheDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_cache"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_weight']);
- }
- }
- private static function removeProductsWeightDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_weight"');
- $CLICSHOPPING_Db->delete('cronjob', ['app_code' => 'app_tools_cronjob']);
- }
- }
- private static function removeProductsCronjobDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_cronjob"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_administrator_menu']);
- }
- }
- private static function removeProductsAdministratorMenuDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_administrator_menu"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_marketing_banner_manager']);
- }
- }
- private static function removeProductsBannerManagerDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_banner_manager"');
- * Logs an error message if debugging is enabled.
- * This function is used to log errors related to database operations.
- *
- * @param string $message The error message to log
- */
- private static function logError($message)
- {
- if (\defined('CLICSHOPPING_APP_CHATGPT_RA_DEBUG_RAG_MANAGER') && CLICSHOPPING_APP_CHATGPT_RA_OPENAI_EMBEDDING == 'True') {
- error_log($message);
- }
- }
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_template_email']);
- }
- }
- private static function removeProductsTemplateEmailDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_template_email"');
- Cache::clear('menu-administrator');
- }
- private static function removeDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_products"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_customers_groups']);
- }
- }
- private static function removeDataDb()
- {
- /*
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_customers_groups"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_api']);
- }
- }
- private static function removeProductsApiDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_api"');
- $CLICSHOPPING_Db->delete('administrator_menu', ['app_code' => 'app_configuration_chatgpt']);
- }
- }
- private static function removeProductsChatGptDb()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qcheck = $CLICSHOPPING_Db->query('show tables like ":table_gpt"');
- /**
- * Initializes and returns an OpenAIChat instance configured with specified parameters.
- *
- * @return mixed An instance of the OpenAIChat class configured for GPT functionality.
- */
- private static function chat(): mixed // Not use currently
- {
- $api_key = self::getApiKey();
- $parameters = ['model' => CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL];
- $config = new OpenAIConfig();
Your project should always define methods and properties visibility explicitly
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.method_or_property_missing_visibility
- public function keys()
- {
- return array('CLICSHOPPING_APP_TABLE_TA_SORT_ORDER');
- }
- function getShippableTotal()
- {
- $CLICSHOPPING_Db = Registry::get('Db');
- $CLICSHOPPING_Currencies = Registry::get('Currencies');
- $CLICSHOPPING_ShoppingCart = Registry::get('ShoppingCart');
- $CLICSHOPPING_Order = Registry::get('Order');
gyakutsuki
gyakutsuki
gyakutsuki
gyakutsuki