Your project uses non-strict array lookups 408

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

New rule! We've recently added this rule to Insight. Don't be surprised to see new suggestions even though the codebase didn't change.
  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. $errors = [];
  2. // ============================================================================
  3. // 1. Reset Translation Cache
  4. // ============================================================================
  5. if (in_array('translations', $cacheTypes)) {
    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. try {
  7. $translationCache = new TranslationCache();
  8. // Count files before
  9. $cacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
  1. }
  2. // ============================================================================
  3. // 3. Reset Classification Cache
  4. // ============================================================================
  5. if (in_array('classification', $cacheTypes)) {
    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. try {
  7. $classificationCache = new ClassificationCache();
  8. // Get stats before
  9. $statsBefore = $classificationCache->getStatistics();
  1. }
  2. // ============================================================================
  3. // 3. Reset Database Query Cache
  4. // ============================================================================
  5. if (in_array('database', $cacheTypes)) {
    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. try {
  7. $db = Registry::get('Db');
  8. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  9. // Count entries before
  1. }
  2. // ============================================================================
  3. // 4. Reset Schema Query Cache (TASK 5 - ITEM 1)
  4. // ============================================================================
  5. if (in_array('schema', $cacheTypes)) {
    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. try {
  7. // Count schema cache files before (new location)
  8. $schemaCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SchemaQuery/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 5. Reset Intent Classification Cache (TASK 5.1.7.6)
  4. // ============================================================================
  5. if (in_array('intent', $cacheTypes)) {
    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. try {
  7. // Count intent cache files before (new location - all files)
  8. $intentCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Intent/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 6. Reset Ambiguity Cache (TASK 4 - Cache Migration)
  4. // ============================================================================
  5. if (in_array('ambiguity', $cacheTypes)) {
    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. try {
  7. // Count ambiguity cache files before (new location - all files)
  8. $ambiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Ambiguity/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 7. Reset Translation Ambiguity Cache
  4. // ============================================================================
  5. if (in_array('translation_ambiguity', $cacheTypes)) {
    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. try {
  7. // Count translation ambiguity cache files before (new location)
  8. $translationAmbiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 8. Reset Context Cache
  4. // ============================================================================
  5. if (in_array('context', $cacheTypes)) {
    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. try {
  7. // Count context cache files before (new location)
  8. $contextCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Context/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 8.5. Reset Memory Cache (file-based)
  4. // ============================================================================
  5. if (in_array('memory', $cacheTypes)) {
    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. try {
  7. $memoryCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Memory/';
  8. $filesBefore = 0;
  9. if (is_dir($memoryCacheDir)) {
  1. }
  2. // ============================================================================
  3. // 9. Reset Embedding Cache
  4. // ============================================================================
  5. if (in_array('embedding', $cacheTypes)) {
    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. try {
  7. // Count embedding cache files before (new location)
  8. $embeddingCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embedding/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 10. Reset EmbeddingSearch Cache
  4. // ============================================================================
  5. if (in_array('embedding_search', $cacheTypes)) {
    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. try {
  7. // Count embedding search cache files before (new location)
  8. $embeddingSearchCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/EmbeddingSearch/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 11. Reset Hybrid Query Cache (TASK 8: Multi-temporal query caching)
  4. // ============================================================================
  5. if (in_array('hybrid', $cacheTypes)) {
    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. try {
  7. // Count hybrid cache files before
  8. $hybridCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Hybrid/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 12. Reset Semantic Query Cache (TASK 8: Multi-temporal query caching)
  4. // ============================================================================
  5. if (in_array('semantic', $cacheTypes)) {
    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. try {
  7. // Count hybrid cache files before
  8. $semanticCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Semantic/';
  9. $filesBefore = 0;
  1. }
  2. // ============================================================================
  3. // 13. Reset Embeddings Cache (PHASE 2 - NewVector cache)
  4. // ============================================================================
  5. if (in_array('embeddings', $cacheTypes)) {
    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. try {
  7. $embeddingsCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embeddings/';
  8. $filesBefore = 0;
  9. if (is_dir($embeddingsCacheDir)) {
  1. }
  2. // ============================================================================
  3. // 14. Reset SQL Query Cache (PHASE 4)
  4. // ============================================================================
  5. if (in_array('sql', $cacheTypes)) {
    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. try {
  7. $sqlCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SQL/';
  8. $filesBefore = 0;
  9. if (is_dir($sqlCacheDir)) {
  1. }
  2. // ============================================================================
  3. // 15. Reset Security Cache
  4. // ============================================================================
  5. if (in_array('security', $cacheTypes)) {
    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. try {
  7. $securityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Security/';
  8. $filesBefore = 0;
  9. if (is_dir($securityCacheDir)) {
  1. }
  2. // ============================================================================
  3. // 16. Reset Reputation Cache
  4. // ============================================================================
  5. if (in_array('reputation', $cacheTypes)) {
    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. try {
  7. $reputationCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Reputation/';
  8. $filesBefore = 0;
  9. if (is_dir($reputationCacheDir)) {
  1. }
  2. // ============================================================================
  3. // 17. Reset Config Cache
  4. // ============================================================================
  5. if (in_array('config', $cacheTypes)) {
    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. try {
  7. $configCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Config/';
  8. $filesBefore = 0;
  9. if (is_dir($configCacheDir)) {
  1. // Assess impact based on query type and failed operations
  2. switch ($queryType) {
  3. case 'semantic':
  4. // For semantic queries, embeddings are critical
  5. if (in_array('embeddings', $failedOps)) {
    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. return 'significant'; // Embeddings are essential for semantic search
  7. }
  8. if (in_array('memory', $failedOps)) {
  9. return 'moderate'; // Memory helps but not critical
  10. }
  1. case 'semantic':
  2. // For semantic queries, embeddings are critical
  3. if (in_array('embeddings', $failedOps)) {
  4. return 'significant'; // Embeddings are essential for semantic search
  5. }
  6. if (in_array('memory', $failedOps)) {
    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
  7. return 'moderate'; // Memory helps but not critical
  8. }
  9. return 'minimal';
  10. case 'analytics':
  1. }
  2. return 'minimal';
  3. case 'analytics':
  4. // For analytics queries, entities are critical
  5. if (in_array('entities', $failedOps)) {
    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. return 'significant'; // Entities are essential for analytics
  7. }
  8. if (in_array('memory', $failedOps)) {
  9. return 'minimal'; // Memory less important for analytics
  10. }
  1. case 'analytics':
  2. // For analytics queries, entities are critical
  3. if (in_array('entities', $failedOps)) {
  4. return 'significant'; // Entities are essential for analytics
  5. }
  6. if (in_array('memory', $failedOps)) {
    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
  7. return 'minimal'; // Memory less important for analytics
  8. }
  9. return 'minimal';
  10. case 'hybrid':
  1. error_log("ConversationMemory::recordFeedback - Interaction ID: {$interactionId}");
  2. error_log("ConversationMemory::recordFeedback - Feedback Type: {$feedbackType}");
  3. // Validate feedback type
  4. $validTypes = ['positive', 'negative', 'correction'];
  5. if (!in_array($feedbackType, $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. error_log("ConversationMemory::recordFeedback - INVALID TYPE: {$feedbackType}");
  7. $this->securityLogger->logSecurityEvent(
  8. "Invalid feedback type: {$feedbackType}. Must be one of: " . implode(', ', $validTypes),
  9. 'warning'
  10. );
  1. foreach ($allEntityTypes as $entityType) {
  2. // Skip system tables that shouldn't be included in context resolution
  3. // IMPORTANT: Use correct table names with '_embedding' suffix for embedding tables
  4. // See docs/RAG_TABLE_NAMING_CONVENTION.md for complete documentation
  5. if (in_array($entityType, [
    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. 'rag_conversation_memory_embedding', // Embedding table: conversation history
  7. 'rag_correction_patterns_embedding', // Embedding table: correction patterns
  8. 'rag_web_cache_embedding', // Embedding table: web cache
  9. 'rag_memory_retention_log' // System table: retention logs (no embedding)
  10. ])) {
  1. }
  2. }
  3. // Also try with entity type name directly
  4. // Matches: "supplier ABC Corp", "manufacturer XYZ Inc"
  5. if (in_array($entityType, ['suppliers', 'manufacturers', 'categories'])) {
    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. $namePattern = '/\b(?:' . preg_quote($singularType, '/') . ')\s+(["\']?)([^"\']+)\1/i';
  7. if (preg_match_all($namePattern, $content, $matches)) {
  8. if (!isset($entities[$entityType])) {
  9. $entities[$entityType] = [];
  1. public function recordFeedback(string $interactionId,string $feedbackType, array $feedbackData): bool
  2. {
  3. try {
  4. // Validate feedback type
  5. $validTypes = ['positive', 'negative', 'correction'];
  6. if (!in_array($feedbackType, $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
  7. throw new \InvalidArgumentException("Invalid feedback type: {$feedbackType}");
  8. }
  9. // Extract required data
  10. $userId = $feedbackData['user_id'] ?? 'unknown';
  1. ], $meta);
  2. // Ensure the scope array is initialized (though it should be by createScope/enterScope)
  3. $this->scopes[$this->currentScope] ??= [];
  4. if (!in_array($scopedKey, $this->scopes[$this->currentScope])) {
    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. $this->scopes[$this->currentScope][] = $scopedKey;
  6. }
  7. if ($this->debug) {
  8. $this->securityLogger->logSecurityEvent("WorkingMemory set: {$scopedKey} = " . $this->formatValueForLog($value), 'info');
  1. unset($this->storage[$scopedKey]);
  2. unset($this->metadata[$scopedKey]);
  3. // Remove from the scope's key list
  4. $scopeKeys = $this->scopes[$this->currentScope] ?? [];
  5. $index = array_search($scopedKey, $scopeKeys);
    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 ($index !== false) {
  7. array_splice($this->scopes[$this->currentScope], $index, 1);
  8. }
  1. break;
  2. }
  3. }
  4. // If web search keyword found but not in sub_types, add it
  5. if ($hasWebSearchKeyword && !in_array('web_search', $intent['sub_types'])) {
    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. $intent['sub_types'][] = 'web_search';
  7. if ($this->debug) {
  8. $this->securityLogger->logStructured('info', 'OrchestratorAgent', 'web_search_detection', [
  9. 'query' => substr($queryToProcess, 0, 100),
  1. ]);
  2. $this->workingMemory->set('reasoning_result', $reasoning);
  3. // default to semantic (safer fallback than analytics)
  4. if ($intent['confidence'] < 0.6 && !in_array($intent['type'], ['analytics', 'semantic', 'web_search', 'hybrid'])) {
    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. $this->securityLogger->logStructured(
  6. 'warning',
  7. 'OrchestratorAgent',
  8. 'fallback_to_semantic',
  9. [
  1. $hasWebSearchKeyword = true;
  2. break;
  3. }
  4. }
  5. if ($hasWebSearchKeyword && !in_array('web_search', $intent['sub_types'])) {
    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. $intent['sub_types'][] = 'web_search';
  7. if ($this->debug) {
  8. $this->securityLogger->logStructured('info', 'OrchestratorAgent', 'web_search_detection_fallback', [
  9. 'query' => substr($queryToProcess, 0, 100),
  1. $this->performanceMetrics = array_merge($this->performanceMetrics, $metrics);
  2. }
  3. public function supportsParameter(string $parameter): bool
  4. {
  5. return in_array($parameter, $this->supportedParameters);
    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. }
  7. public function getPerformanceMetric(string $metric): mixed
  8. {
  9. return $this->performanceMetrics[$metric] ?? null;
  1. * @throws NoCapableActorException If no alternative actor available
  2. */
  3. private function selectAlternativeActor(Action $action, array $excludeActorIds): ActorAgentInterface
  4. {
  5. $capableActors = $this->actorRegistry->getCapableActors($action->getType());
  6. $alternatives = array_filter($capableActors, fn($a) => !in_array($a->getActorId(), $excludeActorIds));
    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
  7. if (empty($alternatives)) {
  8. throw new NoCapableActorException("No alternative actor available for action type: {$action->getType()}");
  9. }
  1. ActionResult $result,
  2. int $count,
  3. array $excludeCriticIds
  4. ): array {
  5. $qualifiedCritics = $this->criticRegistry->getQualifiedCritics($result->getOutputType());
  6. $validCritics = array_filter($qualifiedCritics, fn($c) => !in_array($c->getCriticId(), $excludeCriticIds));
    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
  7. if (count($validCritics) < $count) {
  8. throw new InsufficientCriticsException(
  9. "Insufficient additional critics available. Needed: {$count}, Available: " . count($validCritics)
  10. );
  1. ));
  2. }
  3. // Calculate scores excluding outliers
  4. $nonOutlierEvaluations = array_filter($evaluations, function($evaluation) use ($outlierIds) {
  5. return !in_array($evaluation->getEvaluatorAgentId(), $outlierIds);
    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. });
  7. if (empty($nonOutlierEvaluations)) {
  8. // All evaluations are outliers, use median
  9. $allScores = array_map(function($eval) {
  1. // Include outliers with reduced weight
  2. $totalWeightedScore = 0.0;
  3. $totalWeight = 0.0;
  4. foreach ($evaluations as $evaluation) {
  5. $weight = in_array($evaluation->getEvaluatorAgentId(), $outlierIds) ? 0.3 : 1.0;
    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. $totalWeightedScore += $evaluation->getOverallScore() * $weight;
  7. $totalWeight += $weight;
  8. }
  9. $finalScore = $totalWeight > 0 ? $totalWeightedScore / $totalWeight : $consensusScore;
  1. return $this->metadata;
  2. }
  3. public function hasRequiredExpertise(string $expertise): bool
  4. {
  5. return in_array($expertise, $this->requiredExpertise);
    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. }
  7. public function hasSpecialRequirement(string $requirement): bool
  8. {
  9. return in_array($requirement, $this->specialRequirements);
  1. return in_array($expertise, $this->requiredExpertise);
  2. }
  3. public function hasSpecialRequirement(string $requirement): bool
  4. {
  5. return in_array($requirement, $this->specialRequirements);
    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. }
  7. public function isCritical(): bool
  8. {
  9. return $this->priorityLevel === 'critical';
  1. return $this->priorityLevel === 'critical';
  2. }
  3. public function isHighPriority(): bool
  4. {
  5. return in_array($this->priorityLevel, ['high', 'critical']);
    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. }
  7. public function getMetadataValue(string $key): mixed
  8. {
  9. return $this->metadata[$key] ?? null;
  1. $domains = [];
  2. foreach ($criteria as $outputType => $criterion) {
  3. if (is_object($criterion) && method_exists($criterion, 'getDomain')) {
  4. $domain = $criterion->getDomain();
  5. if (!empty($domain) && !in_array($domain, $domains)) {
    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. $domains[] = $domain;
  7. }
  8. }
  9. }
  1. throw new \RuntimeException('LLM selected no critics');
  2. }
  3. // Validate selected critics are from available pool
  4. foreach ($data['selected_critics'] as $criticId) {
  5. if (!in_array($criticId, $availableCriticIds)) {
    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. throw new \RuntimeException("LLM selected invalid critic: {$criticId}");
  7. }
  8. }
  9. return [
  1. $criticId = $critic->getCriticId();
  2. } elseif (is_array($critic) && isset($critic['critic_id'])) {
  3. $criticId = $critic['critic_id'];
  4. }
  5. if ($criticId && in_array($criticId, $criticIds)) {
    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. $selected[] = $critic;
  7. }
  8. }
  9. return $selected;
  1. throw new \RuntimeException("Anomaly {$idx} missing 'description' field");
  2. }
  3. // Validate severity is valid
  4. $validSeverities = ['low', 'medium', 'high'];
  5. if (!in_array($anomaly['severity'], $validSeverities)) {
    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. throw new \RuntimeException(
  7. "Anomaly {$idx} has invalid severity: {$anomaly['severity']}. Must be one of: " .
  8. implode(', ', $validSeverities)
  9. );
  10. }
  1. // Check if permission level allows the action
  2. switch ($permissionLevel) {
  3. case 'full':
  4. return true;
  5. case 'write':
  6. return in_array($action, ['create', 'read', 'update']);
    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
  7. case 'read':
  8. return $action === 'read';
  9. default:
  10. return false;
  11. }
  1. */
  2. public function grantDomainPermission(string $agentId, string $domain, string $permissionLevel): bool
  3. {
  4. try {
  5. $validLevels = ['read', 'write', 'full'];
  6. if (!in_array($permissionLevel, $validLevels)) {
    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
  7. throw new Exception("Invalid permission level: $permissionLevel");
  8. }
  9. // Check if permission already exists
  10. $Qcheck = $this->db->prepare('
  1. ]
  2. ];
  3. // Check if action is allowed for this permission level
  4. if (isset($permissionActions[$permissionLevel])) {
  5. return in_array($action, $permissionActions[$permissionLevel]);
    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. }
  7. // If permission level is unknown, deny access
  8. return false;
  9. }
  1. public function setAgentPermission(string $agentId, string $businessDomain, string $permissionLevel): bool
  2. {
  3. $businessDomain = $this->normalizeDomain($businessDomain);
  4. try {
  5. // Validate permission level
  6. if (!in_array($permissionLevel, $this->validPermissionLevels)) {
    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
  7. throw new Exception("Invalid permission level: $permissionLevel. Must be one of: " .
  8. implode(', ', $this->validPermissionLevels));
  9. }
  10. // Check if permission already exists
  1. // Get agent's permission level
  2. $permissionLevel = $this->getAgentPermissionLevel($agentId, $businessDomain);
  3. // Actions that always require approval regardless of permission level
  4. if (in_array($action, $this->approvalRequiredActions)) {
    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. return true;
  6. }
  7. // Propose permission level always requires approval for write actions
  8. if ($permissionLevel === self::PERMISSION_PROPOSE) {
  1. }
  2. // Execute_safe requires approval for non-safe operations
  3. if ($permissionLevel === self::PERMISSION_EXECUTE_SAFE) {
  4. $unsafeActions = ['delete', 'modify_business_rules', 'modify_rules', 'change_business_logic'];
  5. if (in_array($action, $unsafeActions)) {
    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. return true;
  7. }
  8. }
  9. return false;
  1. ['modify', 'modify'],
  2. ['update', 'update']
  3. ];
  4. foreach ($conflictingOps as $pair) {
  5. if ((in_array($pair[0], $operations1) && in_array($pair[1], $operations2)) ||
    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. (in_array($pair[1], $operations1) && in_array($pair[0], $operations2))) {
  7. return true;
  8. }
  9. }
  1. ['update', 'update']
  2. ];
  3. foreach ($conflictingOps as $pair) {
  4. if ((in_array($pair[0], $operations1) && in_array($pair[1], $operations2)) ||
  5. (in_array($pair[1], $operations1) && in_array($pair[0], $operations2))) {
    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. return true;
  7. }
  8. }
  9. return false;
  1. // Use higher priority
  2. $priorities = ['low' => 1, 'medium' => 2, 'high' => 3, 'critical' => 4];
  3. $priority1 = $priorities[$obj1->getPriority()];
  4. $priority2 = $priorities[$obj2->getPriority()];
  5. $combinedPriority = array_search(max($priority1, $priority2), $priorities);
    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. // Estimate combined time (not just sum, as there may be synergies)
  7. $estimatedTime = (int)(($obj1->getEstimatedCompletionTime() + $obj2->getEstimatedCompletionTime()) * 0.8);
  8. return [
  1. ];
  2. // Extract words
  3. $words = preg_split('/\s+/', strtolower($text));
  4. $words = array_filter($words, function($word) use ($stopWords) {
  5. return strlen($word) > 2 && !in_array($word, $stopWords);
    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. });
  7. return array_values($words);
  8. }
  1. $weightedSum = 0.0;
  2. $totalWeight = 0.0;
  3. foreach ($evaluations as $evaluation) {
  4. $weight = in_array($evaluation->getEvaluatorAgentId(), $outlierAgents) ? 0.5 : 1.0;
    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. $weightedSum += $evaluation->getOverallScore() * $weight;
  6. $totalWeight += $weight;
  7. }
  8. $proposedScore = $totalWeight > 0 ? $weightedSum / $totalWeight : array_sum($scores) / count($scores);
  1. $outlierScores = array_column($outliers, 'score');
  2. $weightedSum = 0.0;
  3. $totalWeight = 0.0;
  4. foreach ($scores as $score) {
  5. $weight = in_array($score, $outlierScores) ? 0.5 : 1.0;
    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. $weightedSum += $score * $weight;
  7. $totalWeight += $weight;
  8. }
  9. return $totalWeight > 0 ? $weightedSum / $totalWeight : array_sum($scores) / count($scores);
  1. // Moderate divergence - use weighted average excluding outliers
  2. $outliers = $context['outliers'] ?? [];
  3. $outlierScores = array_column($outliers, 'score');
  4. $validScores = array_filter($scores, function($score) use ($outlierScores) {
  5. return !in_array($score, $outlierScores);
    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. });
  7. if (!empty($validScores)) {
  8. $finalScore = array_sum($validScores) / count($validScores);
  9. $reasoning[] = "Moderate divergence detected (agreement: " . round($agreementLevel * 100, 1) . "%)";
  1. 'score' => $evaluation->getOverallScore()
  2. ];
  3. // Collect strengths
  4. foreach ($evaluation->getStrengths() as $strength) {
  5. if (!in_array($strength, $allStrengths)) {
    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. $allStrengths[] = $strength;
  7. }
  8. }
  9. // Collect improvements
  1. }
  2. }
  3. // Collect improvements
  4. foreach ($evaluation->getImprovements() as $improvement) {
  5. if (!in_array($improvement, $allImprovements)) {
    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. $allImprovements[] = $improvement;
  7. }
  8. }
  9. }
  1. // Get all capable evaluators
  2. $capableEvaluators = $this->capabilityRegistry->getCapableEvaluators($outputType, 'competent');
  3. // Filter out excluded evaluators
  4. $availableEvaluators = array_filter($capableEvaluators, function($evaluator) use ($excludedEvaluators) {
  5. return !in_array($evaluator['agent_id'], $excludedEvaluators);
    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. });
  7. // If no competent evaluators available, try novice level
  8. if (empty($availableEvaluators)) {
  9. $capableEvaluators = $this->capabilityRegistry->getCapableEvaluators($outputType, 'novice');
  1. // If no competent evaluators available, try novice level
  2. if (empty($availableEvaluators)) {
  3. $capableEvaluators = $this->capabilityRegistry->getCapableEvaluators($outputType, 'novice');
  4. $availableEvaluators = array_filter($capableEvaluators, function($evaluator) use ($excludedEvaluators) {
  5. return !in_array($evaluator['agent_id'], $excludedEvaluators);
    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. });
  7. }
  8. // Return first available evaluator or null
  9. if (!empty($availableEvaluators)) {
  1. throw new Exception('Feedback text is required');
  2. }
  3. // Validate feedback type
  4. $validTypes = ['correctness', 'efficiency', 'completeness', 'best_practice'];
  5. if (!in_array($feedback['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. throw new Exception('Invalid feedback type. Must be one of: ' . implode(', ', $validTypes));
  7. }
  8. try {
  9. $feedbackId = $this->generateFeedbackId();
  1. $updates[] = 'approved_at = :approved_at';
  2. $params[':approved_at'] = (new DateTime())->format('Y-m-d H:i:s');
  3. } elseif ($status === 'active') {
  4. $updates[] = 'started_at = :started_at';
  5. $params[':started_at'] = (new DateTime())->format('Y-m-d H:i:s');
  6. } elseif (in_array($status, ['completed', 'failed', 'cancelled'])) {
    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
  7. $updates[] = 'completed_at = :completed_at';
  8. $params[':completed_at'] = (new DateTime())->format('Y-m-d H:i:s');
  9. }
  10. $sql = "UPDATE :table_rag_agent_objectives
  1. 'delete_agent',
  2. 'modify_security_settings',
  3. 'access_sensitive_data'
  4. ];
  5. if (in_array($actionType, $criticalActions)) {
    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. return 'critical';
  7. }
  8. // High severity actions
  9. $highSeverityActions = [
  1. 'approve_objective',
  2. 'cancel_objective',
  3. 'modify_agent_role'
  4. ];
  5. if (in_array($actionType, $highSeverityActions)) {
    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. return 'high';
  7. }
  8. // Check context for severity indicators
  9. if (isset($context['repeated_attempt']) && $context['repeated_attempt'] === true) {
  1. 'delete_agent',
  2. 'modify_security_settings',
  3. 'access_sensitive_data'
  4. ];
  5. if (in_array($actionType, $criticalActions)) {
    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. return true;
  7. }
  8. // Check for repeated violations
  9. $recentViolations = $this->getRecentViolationCount($agentId);
  1. }
  2. $targetTable = $prefix . $pluralEntity . '_embedding';
  3. // Only search in the specific table if it exists
  4. if (in_array($targetTable, $embeddingTables)) {
    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. $embeddingTables = [$targetTable];
  6. if ($this->debug) {
  7. $this->logger->logSecurityEvent(
  8. "Filtered to specific entity table: {$targetTable}",
  1. }
  2. $sourceAttr = $result['source_attribution'];
  3. // If source is RAG, verify embedding data exists
  4. if (in_array($sourceAttr['source_type'], ['rag', 'semantic', 'embedding'])) {
    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. if (!$this->hasEmbeddingData($result)) {
  6. $validationErrors[] = "RAG source but no document/embedding data found";
  7. return false;
  8. }
  9. }
  1. {
  2. $validTypes = ['low_reputation', 'rapid_change', 'gaming_detected', 'anomaly'];
  3. $validSeverities = ['low', 'medium', 'high', 'critical'];
  4. return !empty($this->criticId)
  5. && in_array($this->alertType, $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. && in_array($this->severity, $validSeverities)
  7. && !empty($this->message);
  8. }
  9. /**
  1. $validTypes = ['low_reputation', 'rapid_change', 'gaming_detected', 'anomaly'];
  2. $validSeverities = ['low', 'medium', 'high', 'critical'];
  3. return !empty($this->criticId)
  4. && in_array($this->alertType, $validTypes)
  5. && in_array($this->severity, $validSeverities)
    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. && !empty($this->message);
  7. }
  8. /**
  9. * Get alert as array for serialization
  1. && $this->consistencyScore >= 0.0
  2. && $this->consistencyScore <= 1.0
  3. && $this->expertiseAccuracy >= 0.0
  4. && $this->expertiseAccuracy <= 1.0
  5. && $this->totalEvaluations >= 0
  6. && in_array($this->status, ['bootstrapping', 'establishing', 'established']);
    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
  7. }
  8. /**
  9. * Get reputation as array for serialization
  10. *
  1. // Type conversion
  2. if ($key === 'enabled') {
  3. $config[$key] = (bool)$value;
  4. } elseif ($key === 'decay_factor') {
  5. $config[$key] = (float)$value;
  6. } elseif (in_array($key, ['period_seconds', 'recent_evaluation_count'])) {
    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
  7. $config[$key] = (int)$value;
  8. }
  9. }
  10. return $config;
  1. 'ALTER', 'TRUNCATE', 'REPLACE', 'SHOW', 'DESCRIBE', 'EXPLAIN'
  2. ];
  3. $firstWord = strtoupper(explode(' ', $input)[0]);
  4. if (in_array($firstWord, $sqlKeywords)) {
    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. return true;
  6. }
  7. if (preg_match('/^\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER|TRUNCATE)\s+/i', $input)) {
  8. return true;
  1. }
  2. return false;
  3. }
  4. // Verify type matches requested types
  5. if (!in_array($subQuery['type'], $requestedTypes)) {
    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. if ($this->debug) {
  7. $this->logDebug("Validation failed: sub-query {$index} type '{$subQuery['type']}' not in requested types");
  8. }
  9. return false;
  10. }
  1. $dependsOn = $metadata['depends_on'] ?? [];
  2. // Filter circular dependencies
  3. $filteredDependsOn = array_filter($dependsOn, function($depId) use ($cycles, $stepId) {
  4. foreach ($cycles as $cycle) {
  5. if (in_array($stepId, $cycle) && in_array($depId, $cycle)) {
    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. // This dependency creates a cycle
  7. return false;
  8. }
  9. }
  10. return true;
  1. 'semantic_search',
  2. 'fallback'
  3. ];
  4. foreach ($steps as $step) {
  5. if (!in_array($step->getType(), $allowedTypes)) {
    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. return false;
  7. }
  8. }
  9. return true;
  1. {
  2. $stepIds = array_map(fn($step) => $step->getId(), $steps);
  3. foreach ($dependencies as $stepId => $deps) {
  4. foreach ($deps['depends_on'] as $depId) {
  5. if (!in_array($depId, $stepIds)) {
    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. return false;
  7. }
  8. }
  9. }
  1. // Additional metadata
  2. if (!empty($metadata)) {
  3. $parts[] = "Additional Context:";
  4. foreach ($metadata as $key => $value) {
  5. if (is_string($value) && !in_array($key, ['entity_type', 'entity_id'])) {
    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. $parts[] = "- {$key}: {$value}";
  7. }
  8. }
  9. $parts[] = "";
  10. }
  1. $result['errors'][] = "Missing required field: {$field}";
  2. }
  3. }
  4. // 3. Validate complexity
  5. if (isset($json['complexity']) && !in_array($json['complexity'], self::COMPLEXITY_LEVELS)) {
    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. $result['errors'][] = "Invalid complexity level: {$json['complexity']}";
  7. }
  8. // 4. Validate steps
  9. if (isset($json['steps'])) {
  1. $errors[] = "Step {$index}: Missing required field '{$field}'";
  2. }
  3. }
  4. // Validate type
  5. if (isset($step['type']) && !in_array($step['type'], self::ALLOWED_STEP_TYPES)) {
    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. $errors[] = "Step {$index}: Invalid type '{$step['type']}'";
  7. }
  8. // Validate unique ID
  9. if (isset($step['id'])) {
  1. $errors[] = "Step {$index}: Invalid type '{$step['type']}'";
  2. }
  3. // Validate unique ID
  4. if (isset($step['id'])) {
  5. if (in_array($step['id'], $existingIds)) {
    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. $errors[] = "Step {$index}: Duplicate ID '{$step['id']}'";
  7. }
  8. if (!preg_match('/^step_\d+$/', $step['id'])) {
  9. $errors[] = "Step {$index}: ID must match pattern 'step_N'";
  1. if (isset($step['depends_on'])) {
  2. if (!is_array($step['depends_on'])) {
  3. $errors[] = "Step {$index}: 'depends_on' must be an array";
  4. } else {
  5. foreach ($step['depends_on'] as $depId) {
  6. if (!in_array($depId, $existingIds)) {
    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
  7. $errors[] = "Step {$index}: Dependency '{$depId}' references non-existent step";
  8. }
  9. }
  10. }
  11. }
  1. foreach ($words as $word) {
  2. // Clean word (remove punctuation)
  3. $cleanWord = preg_replace('/[^\w\-]/', '', $word);
  4. // Ignore short words or stop words
  5. if (strlen($cleanWord) > 2 && !in_array($cleanWord, $stopWords)) {
    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. $keywords[] = $cleanWord;
  7. }
  8. }
  9. return array_unique($keywords);
  1. // Extract type
  2. $type = $classificationResult['type'] ?? 'semantic';
  3. // Validate response (now supports 4 categories)
  4. $validTypes = ['analytics', 'semantic', 'hybrid', 'web_search'];
  5. if (!in_array($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. if ($this->debug) {
  7. $this->logger->logStructured(
  8. 'warning',
  9. 'QueryClassifier',
  1. // Type conversion
  2. if ($key === self::CONFIG_KEY_ENABLED ||
  3. $key === self::CONFIG_KEY_FALLBACK_TO_HYBRID ||
  4. $key === self::CONFIG_KEY_REPUTATION_DECAY_ENABLED) {
  5. $config[$key] = self::parseBool($value);
  6. } elseif (in_array($key, [
    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
  7. self::CONFIG_KEY_CRITICS_PER_EVALUATION,
  8. self::CONFIG_KEY_MIN_CRITICS_REQUIRED,
  9. self::CONFIG_KEY_ACTOR_RETRY_ATTEMPTS,
  10. self::CONFIG_KEY_CRITIC_EVALUATION_TIMEOUT,
  11. self::CONFIG_KEY_MAX_CONCURRENT_ACTIONS_PER_ACTOR,
  1. self::CONFIG_KEY_REPUTATION_DECAY_RECENT_EVAL_COUNT,
  2. self::CONFIG_KEY_REPUTATION_BOOTSTRAP_THRESHOLD_LOW,
  3. self::CONFIG_KEY_REPUTATION_BOOTSTRAP_THRESHOLD_HIGH
  4. ])) {
  5. $config[$key] = (int)$value;
  6. } elseif (in_array($key, [
    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
  7. self::CONFIG_KEY_CONSENSUS_THRESHOLD,
  8. self::CONFIG_KEY_REPUTATION_DECAY_FACTOR,
  9. self::CONFIG_KEY_REPUTATION_DECAY_RATE,
  10. self::CONFIG_KEY_REPUTATION_WEIGHT_CONSENSUS,
  11. self::CONFIG_KEY_REPUTATION_WEIGHT_FEEDBACK,
  1. bool $enabled = true
  2. ): bool {
  3. self::initialize();
  4. // Validate type
  5. if (!in_array($type, [self::AGENT_TYPE_ACTOR, self::AGENT_TYPE_CRITIC, self::AGENT_TYPE_HYBRID])) {
    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. if (self::$debug) {
  7. error_log("AgentActivationConfig: Invalid agent type: {$type}");
  8. }
  9. return false;
  10. }
  1. foreach ($results as $row) {
  2. $count = $row['count'] ?? 0;
  3. $feedback_type = $row['feedback_type'] ?? '';
  4. $total += $count;
  5. if (\in_array($feedback_type, ['positive', 'helpful', 'thumbs_up'])) {
    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. $positive += $count;
  7. } elseif (\in_array($feedback_type, ['negative', 'unhelpful', 'thumbs_down'])) {
  8. $negative += $count;
  9. }
  10. }
  1. $feedback_type = $row['feedback_type'] ?? '';
  2. $total += $count;
  3. if (\in_array($feedback_type, ['positive', 'helpful', 'thumbs_up'])) {
  4. $positive += $count;
  5. } elseif (\in_array($feedback_type, ['negative', 'unhelpful', 'thumbs_down'])) {
    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. $negative += $count;
  7. }
  8. }
  9. $satisfaction_rate = $total > 0 ? round(($positive / $total) * 100, 1) : 0;
  1. // "recent" is rarely what users want, so it's last
  2. $priority = ['sum', 'count', 'list', 'recent'];
  3. $selected = [];
  4. foreach ($priority as $type) {
  5. if (in_array($type, $availableInterpretations)) {
    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. $selected[] = $type;
  7. if (count($selected) >= $count) {
  8. break;
  9. }
  10. }
  1. }
  2. }
  3. // Fill remaining with any available interpretations
  4. foreach ($availableInterpretations as $type) {
  5. if (!in_array($type, $selected)) {
    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. $selected[] = $type;
  7. if (count($selected) >= $count) {
  8. break;
  9. }
  10. }
  1. // Check for single day + weekly/monthly aggregation
  2. if (TemporalConflictPattern::isSingleDayRange($timeRange)) {
  3. $coarseAggregationPeriods = TemporalConflictPattern::getCoarseAggregationPeriods();
  4. foreach ($temporalPeriods as $period) {
  5. if (in_array(strtolower($period), $coarseAggregationPeriods)) {
    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. return [
  7. 'has_conflict' => true,
  8. 'conflict_type' => 'granularity_too_coarse',
  9. 'conflict_details' => "Cannot aggregate by '{$period}' for a single day ('{$timeRange}'). A single day cannot be broken down into {$period}s.",
  10. 'suggested_clarification' => "Did you want daily data for '{$timeRange}', or did you mean to specify a longer time range for {$period}ly aggregation?",
  1. $relatedTable = $safeRelatedTable;
  2. }
  3. $prefix = CLICSHOPPING::getConfig('prefix_table');
  4. // Check if the related table exists
  5. if (in_array($relatedTable, $tables) || in_array($prefix . $relatedTable, $tables)) {
    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. $actualTable = in_array($prefix . $relatedTable, $tables) ? $prefix . $relatedTable : $relatedTable;
  7. $this->tableRelationships[$table][$column] = $actualTable;
  8. }
  9. }
  10. }
  1. }
  2. $prefix = CLICSHOPPING::getConfig('prefix_table');
  3. // Check if the related table exists
  4. if (in_array($relatedTable, $tables) || in_array($prefix . $relatedTable, $tables)) {
  5. $actualTable = in_array($prefix . $relatedTable, $tables) ? $prefix . $relatedTable : $relatedTable;
    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. $this->tableRelationships[$table][$column] = $actualTable;
  7. }
  8. }
  9. }
  10. }
  1. // Handle escaped quotes (e.g., \' or \")
  2. // Look for patterns like LIKE '%iPhone\'s%'
  3. $escapedPattern = '/LIKE\s+\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/i';
  4. if (preg_match_all($escapedPattern, $sql, $matches)) {
  5. foreach ($matches[1] as $pattern) {
  6. if (!in_array($pattern, $allMatches)) {
    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
  7. $allMatches[] = $pattern;
  8. }
  9. }
  10. }
  1. // Filter interpretations to keep only selected types
  2. $analysis['interpretations'] = array_filter(
  3. $analysis['interpretations'],
  4. function($interp) use ($selectedTypes) {
  5. return in_array($interp['type'] ?? '', $selectedTypes);
    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. }
  7. );
  8. // Re-index array
  9. $analysis['interpretations'] = array_values($analysis['interpretations']);
  1. }
  2. public function canHandle(array $results): bool
  3. {
  4. $type = $results['type'] ?? '';
  5. return in_array($type, ['analytics_results', 'analytics_response']);
    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. }
  7. public function format(array $results): array
  8. {
  9. $question = $results['question'] ?? $results['query'] ?? 'Unknown request';
  1. // First pass: Check for "by {period}" or "per {period}" patterns
  2. foreach ($basePeriods as $basePeriod => $variants) {
  3. foreach ($variants as $variant) {
  4. // Check for "by {period}" pattern
  5. if (preg_match('/\bby\s+' . preg_quote($variant, '/') . '\b/i', $query)) {
  6. if (!in_array($basePeriod, $detected)) {
    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
  7. $detected[] = $basePeriod;
  8. }
  9. break;
  10. }
  11. // Check for "per {period}" pattern
  1. }
  2. break;
  3. }
  4. // Check for "per {period}" pattern
  5. if (preg_match('/\bper\s+' . preg_quote($variant, '/') . '\b/i', $query)) {
  6. if (!in_array($basePeriod, $detected)) {
    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
  7. $detected[] = $basePeriod;
  8. }
  9. break;
  10. }
  11. }
  1. foreach ($basePeriods as $basePeriod => $variants) {
  2. foreach ($variants as $variant) {
  3. // Check if the period appears anywhere in the query
  4. if (preg_match('/\b' . preg_quote($variant, '/') . '\b/i', $query)) {
  5. if (!in_array($basePeriod, $detected)) {
    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. $detected[] = $basePeriod;
  7. }
  8. break;
  9. }
  10. }
  1. * @return bool True if it's an entity table
  2. */
  3. public function isEntityTable(string $tableName): bool
  4. {
  5. $allTables = $this->getAllEntityTables();
  6. return in_array($tableName, $allTables);
    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
  7. }
  8. /**
  9. * Check if a table is an embedding table
  10. *
  1. * @return bool True if it's a memory table
  2. */
  3. public function isMemoryTable(string $tableName): bool
  4. {
  5. $memoryTables = $this->getMemoryTables();
  6. return in_array($tableName, $memoryTables);
    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
  7. }
  8. /**
  9. * Get table metadata
  10. *
  1. * @return void
  2. */
  3. public function registerEntityTable(string $tableName, string $idColumn, ?string $entityType = null): void
  4. {
  5. // Add to entity table cache (IN-MEMORY ONLY)
  6. if (!in_array($tableName, $this->entityTableCache)) {
    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
  7. $this->entityTableCache[] = $tableName;
  8. }
  9. // Add to ID column cache (IN-MEMORY ONLY)
  10. $this->idColumnCache[$tableName] = $idColumn;
  1. private function mapTemporalColumnName(string $column, string $temporalPeriod, string $languageCode): string
  2. {
  3. // Check for period-related columns
  4. $periodColumns = ['period', 'month', 'quarter', 'semester', 'year', 'week', 'day', 'MONTH', 'QUARTER', 'YEAR', 'WEEK'];
  5. if (in_array($column, $periodColumns) || stripos($column, 'period') !== false) {
    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. return $this->getTemporalColumnLabel($temporalPeriod, $languageCode);
  7. }
  8. // Standard column name mapping
  9. return ucwords(str_replace('_', ' ', $column));
  1. }
  2. // Check if this is a period column that needs temporal formatting
  3. $periodColumns = ['period', 'month', 'quarter', 'semester', 'year', 'week', 'day', 'MONTH', 'QUARTER', 'YEAR', 'WEEK'];
  4. if (in_array($column, $periodColumns) || stripos($column, 'period') !== false) {
    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. return $this->formatTemporalLabel($temporalPeriod, $value, $languageCode);
  6. }
  7. // Format numeric values
  8. if (is_numeric($value)) {
  1. }
  2. $filteredRow = [];
  3. foreach ($row as $key => $value) {
  4. if (!in_array($key, $systemFields)) {
    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. $filteredRow[$key] = $value;
  6. }
  7. }
  8. return $filteredRow;
  1. public function canHandle(array $results): bool
  2. {
  3. $type = $results['type'] ?? '';
  4. // Note: 'hybrid' is now handled by HybridFormatter (priority 105)
  5. // ComplexQueryFormatter handles 'complex_query' and legacy 'hybrid_results'
  6. return in_array($type, ['complex_query', 'hybrid_results']);
    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
  7. }
  8. /**
  9. * Format complex query results for display
  10. *
  1. $score = 0;
  2. $factors = [];
  3. // Factor 1: Result type
  4. $type = $results['type'] ?? '';
  5. if (in_array($type, ['complex_query', 'hybrid'])) {
    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. $score += 30;
  7. $factors[] = 'complex_type';
  8. if ($this->debug) {
  9. error_log('[INFO] Complexity factor: complex_type (+30)');
  10. }
  1. $score += 30;
  2. $factors[] = 'complex_type';
  3. if ($this->debug) {
  4. error_log('[INFO] Complexity factor: complex_type (+30)');
  5. }
  6. } elseif (in_array($type, ['analytics_results', 'analytics_response'])) {
    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
  7. $score += 10;
  8. $factors[] = 'analytics_type';
  9. if ($this->debug) {
  10. error_log('[INFO] Complexity factor: analytics_type (+10)');
  11. }
  1. $type = 'web';
  2. }
  3. // Validate response (supports 4 categories)
  4. $validTypes = ['analytic', 'semantic', 'web', 'hybrid'];
  5. if (!in_array($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. if ($this->debug) {
  7. $this->logWarning("LLM returned invalid type", [
  8. 'type' => $type,
  9. 'defaulting_to' => 'semantic'
  10. ]);
  1. {
  2. sort($queryTypes);
  3. $typeKey = implode('_', $queryTypes);
  4. // Price comparison: analytics + web_search
  5. if (in_array('analytics', $queryTypes) && in_array('web_search', $queryTypes)) {
    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. return 'price_comparison';
  7. }
  8. // Semantic + analytics
  9. if (in_array('semantic', $queryTypes) && in_array('analytics', $queryTypes)) {
  1. if (in_array('analytics', $queryTypes) && in_array('web_search', $queryTypes)) {
  2. return 'price_comparison';
  3. }
  4. // Semantic + analytics
  5. if (in_array('semantic', $queryTypes) && in_array('analytics', $queryTypes)) {
    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. return 'semantic_analytics';
  7. }
  8. // Default for all other combinations
  9. return 'default';
  1. private function translateMonthName(string $monthName, string $languageCode): string
  2. {
  3. $englishMonths = ['January', 'February', 'March', 'April', 'May', 'June',
  4. 'July', 'August', 'September', 'October', 'November', 'December'];
  5. $monthIndex = array_search(ucfirst(strtolower($monthName)), $englishMonths);
    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 ($monthIndex === false) {
  7. return $monthName; // Return as-is if not found
  8. }
  9. $targetMonths = $this->getMonthNames($languageCode);
  1. if ($actualType !== $expectedType) {
  2. $errors[] = "Expected type '{$expectedType}', got '{$actualType}'";
  3. }
  4. // Range validation for numeric types
  5. if (in_array($expectedType, ['int', 'float'])) {
    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. if (isset($paramDef['min']) && $value < $paramDef['min']) {
  7. $errors[] = "Value {$value} is below minimum {$paramDef['min']}";
  8. }
  9. if (isset($paramDef['max']) && $value > $paramDef['max']) {
  10. $errors[] = "Value {$value} is above maximum {$paramDef['max']}";
  1. $errors[] = "Value {$value} is above maximum {$paramDef['max']}";
  2. }
  3. }
  4. // Enum validation
  5. if (isset($paramDef['allowed_values']) && !in_array($value, $paramDef['allowed_values'])) {
    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. $errors[] = "Value '{$value}' is not in allowed values: " . implode(', ', $paramDef['allowed_values']);
  7. }
  8. return [
  9. 'valid' => empty($errors),
  1. $hasWarnings = true;
  2. }
  3. // Check for flagged or rejected grounding decision
  4. if (isset($groundingMetadata['grounding_decision']) &&
  5. in_array($groundingMetadata['grounding_decision'], ['FLAG', 'REJECT'])) {
    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. $hasWarnings = true;
  7. }
  8. if (!$hasWarnings) {
  9. return '';
  1. throw new \Exception('Missing required fields in JSON response');
  2. }
  3. // Validate type (must be one of 4 categories)
  4. $validTypes = ['analytics', 'semantic', 'hybrid', 'web_search'];
  5. if (!in_array($result['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. throw new \Exception('Invalid type: ' . $result['type']);
  7. }
  8. // Validate confidence (must be between 0.0 and 1.0)
  9. $confidence = (float)$result['confidence'];
  1. $response = Gpt::getGptResponse($prompt, 20);
  2. $type = trim(strtolower($response));
  3. // Validate old prompt response - default to 'semantic' if invalid
  4. if (!in_array($type, ['analytics', 'semantic'])) {
    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. $type = 'semantic'; // Default fallback
  6. }
  7. // Return in new format with default values
  8. return [
  1. // Also matches: "of [product] on [site]", "for [product] on [site]"
  2. if (preg_match('/\b(price|find|search|look|check|cheaper|available|of|for)\s+.*?\s+(on|at)\s+(\w+)/i', $query, $matches)) {
  3. $site = strtolower($matches[3]);
  4. // Exclude internal keywords
  5. if (!in_array($site, WebSearchPatterns::$internalKeywords)) {
    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. $analysis['intent_type'] = 'web_search';
  7. $analysis['confidence'] = 0.95;
  8. $analysis['override_reason'] = "External site pattern detected: on/at $site";
  9. $analysis['detection_method'] = 'pattern_post_filter';
  10. return $analysis;
  1. // Handles queries where price keyword comes before "on [site]"
  2. if (preg_match('/\b(what|how|show|get|tell)\s+.*?\s+(on|at)\s+(\w+)/i', $query, $matches)) {
  3. $site = strtolower($matches[3]);
  4. // Exclude internal keywords
  5. if (!in_array($site, WebSearchPatterns::$internalKeywords)) {
    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. $analysis['intent_type'] = 'web_search';
  7. $analysis['confidence'] = 0.95;
  8. $analysis['override_reason'] = "External site pattern detected: on/at $site";
  9. $analysis['detection_method'] = 'pattern_post_filter';
  10. return $analysis;
  1. */
  2. public function setDefaultEngine(string $engine): void
  3. {
  4. $allowed = ['google', 'bing', 'duckduckgo', 'yahoo'];
  5. if (!in_array($engine, $allowed)) {
    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. throw new \InvalidArgumentException("Engine must be one of: " . implode(', ', $allowed));
  7. }
  8. $this->defaultEngine = $engine;
  9. }
  1. return $left;
  2. };
  3. $parseMulDiv = function() use (&$parsePower, $expr, &$pos) {
  4. $left = $parsePower();
  5. while ($pos < strlen($expr) && in_array($expr[$pos], ['*', '/', '%'])) {
    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. $op = $expr[$pos++];
  7. $right = $parsePower();
  8. $left = match($op) {
  9. '*' => $left * $right,
  10. '/' => $right != 0 ? $left / $right : throw new \Exception('Division by zero'),
  1. return $left;
  2. };
  3. $parseAddSub = function() use (&$parseMulDiv, $expr, &$pos) {
  4. $left = $parseMulDiv();
  5. while ($pos < strlen($expr) && in_array($expr[$pos], ['+', '-'])) {
    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. $op = $expr[$pos++];
  7. $right = $parseMulDiv();
  8. $left = $op === '+' ? $left + $right : $left - $right;
  9. }
  10. return $left;
  1. // À implémenter avec Slack API
  2. });
  3. // Canal: SMS (placeholder)
  4. $this->addNotificationChannel('sms', function($alert) {
  5. if (in_array($alert['severity'], [self::SEVERITY_ERROR, self::SEVERITY_CRITICAL])) {
    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. // À implémenter avec votre système SMS
  7. }
  8. });
  9. }
  1. public function isHealthy(): bool
  2. {
  3. $snapshot = $this->collectMetrics();
  4. $health = $this->calculateOverallHealth($snapshot);
  5. return in_array($health['status'], ['healthy', 'warning']);
    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. }
  7. /**
  8. * Gets API metrics
  9. *
  1. * @throws \InvalidArgumentException If agent type is invalid
  2. */
  3. public function getSystemMessage(string $agentType = 'analytics', string $query = '', string $modelName = 'gpt-4o-mini'): string
  4. {
  5. // Validate agent type
  6. if (!in_array($agentType, self::AGENT_TYPES)) {
    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
  7. throw new \InvalidArgumentException("Invalid agent type: {$agentType}. Supported types: " . implode(', ', self::AGENT_TYPES));
  8. }
  9. // Store parameters for buildSystemMessage()
  10. $this->agentType = $agentType;
  1. * @return bool True if analytics response
  2. */
  3. private function isAnalyticsResponse(array $response): bool
  4. {
  5. $type = $response['response_type'] ?? '';
  6. return in_array($type, ['analytics_response', 'analytics_results', 'analytics']);
    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
  7. }
  8. /**
  9. * Ensure SQL is extracted for analytics responses
  10. *
  1. * @return array Adjusted response
  2. */
  3. private function applyModelSpecificAdjustments(array $response, string $model): array
  4. {
  5. // GPT-4.x series: May have truncated responses due to context limits
  6. if (in_array($model, ['gpt-4', 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano'])) {
    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
  7. $response = $this->handleGpt4Truncation($response);
  8. }
  9. // GPT-5.x series: Newer models may also hit limits; handle truncation similarly
  10. if (in_array($model, ['gpt-5.2', 'gpt-5.2-pro', 'gpt-5-mini'])) {
  1. if (in_array($model, ['gpt-4', 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano'])) {
  2. $response = $this->handleGpt4Truncation($response);
  3. }
  4. // GPT-5.x series: Newer models may also hit limits; handle truncation similarly
  5. if (in_array($model, ['gpt-5.2', 'gpt-5.2-pro', 'gpt-5-mini'])) {
    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. $response = $this->handleGpt5Truncation($response);
  7. }
  8. // Local models (GPT-OSS, Phi-4, Mistral): May have formatting variations
  9. if (in_array($model, ['gpt-oss', 'phi-4', 'mistral-large', 'mistral-medium'])) {
  1. if (in_array($model, ['gpt-5.2', 'gpt-5.2-pro', 'gpt-5-mini'])) {
  2. $response = $this->handleGpt5Truncation($response);
  3. }
  4. // Local models (GPT-OSS, Phi-4, Mistral): May have formatting variations
  5. if (in_array($model, ['gpt-oss', 'phi-4', 'mistral-large', 'mistral-medium'])) {
    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. $response = $this->handleLocalModelVariations($response);
  7. }
  8. return $response;
  9. }
  1. if (isset($response['interpretation'])) {
  2. $interpretation = $response['interpretation'];
  3. $lastChar = substr($interpretation, -1);
  4. // If doesn't end with punctuation, may be truncated
  5. if (!in_array($lastChar, ['.', '!', '?', ')', ']', '}'])) {
    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. $response['interpretation'] .= ' [Response may be truncated due to context limit]';
  7. $response['truncated'] = true;
  8. }
  9. }
  1. {
  2. if (isset($response['interpretation'])) {
  3. $interpretation = $response['interpretation'];
  4. $lastChar = substr($interpretation, -1);
  5. if (!in_array($lastChar, ['.', '!', '?', ')', ']', '}'])) {
    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. $response['interpretation'] .= ' [Response may be truncated due to context limit]';
  7. $response['truncated'] = true;
  8. }
  9. }
  1. }
  2. // Additional URL validation for allowed schemes
  3. if (isset($options['allowedSchemes'])) {
  4. $scheme = parse_url($input, PHP_URL_SCHEME);
  5. if (!in_array($scheme, $options['allowedSchemes'])) {
    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. self::logSecurityEvent("URL scheme not allowed: $scheme");
  7. return $default ?? '';
  8. }
  9. }
  1. }
  2. // Check file extension if extensions are specified
  3. if (!empty($allowedExtensions)) {
  4. $extension = strtolower(pathinfo($realPath, PATHINFO_EXTENSION));
  5. if (!in_array($extension, array_map('strtolower', $allowedExtensions))) {
    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. self::logSecurityEvent("File has disallowed extension: $extension");
  7. return false;
  8. }
  9. }
  1. // Insert into database
  2. $this->db->save($table, $data);
  3. // Check if we should trigger alerts (for threat events)
  4. if (in_array($eventType, ['threat_detected', 'threat_blocked']) && isset($details['blocked']) && $details['blocked']) {
    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. $this->checkAndTriggerAlerts();
  6. }
  7. return true;
  8. } catch (\Exception $e) {
  1. $severity = 'medium';
  2. }
  3. // Map detection_method to valid ENUM value
  4. $detectionMethod = $context['detection_method'] ?? 'llm_semantic';
  5. if (!in_array($detectionMethod, ['llm_semantic', 'pattern_based', 'response_validation', 'hybrid'])) {
    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. $detectionMethod = 'llm_semantic'; // default
  7. }
  8. $safeContext = $context;
  9. unset($safeContext['detection_method']);
  1. ]
  2. );
  3. // Map detection_method to valid ENUM value
  4. $detectionMethod = $context['detection_method'] ?? 'pattern_based';
  5. if (!in_array($detectionMethod, ['llm_semantic', 'pattern_based', 'response_validation', 'hybrid'])) {
    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. $detectionMethod = 'pattern_based'; // default for fallback
  7. }
  8. $safeContext = $context;
  9. unset($safeContext['detection_method']);
  1. // Clamp confidence to [0.0, 1.0]
  2. $analysis['confidence'] = min(1.0, max(0.0, (float)$analysis['confidence']));
  3. // Validate threat_type
  4. $validThreatTypes = ['instruction_override', 'exfiltration', 'hallucination', 'none'];
  5. if (!\in_array($analysis['threat_type'], $validThreatTypes)) {
    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. self::$logger->logSecurityEvent(
  7. "Invalid threat_type: " . $analysis['threat_type'] . ", defaulting to 'none'",
  8. 'warning'
  9. );
  10. $analysis['threat_type'] = 'none';
  1. if (!isset($columns[$table])) {
  2. $columns[$table] = [];
  3. }
  4. if (!in_array($column, $columns[$table])) {
    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. $columns[$table][] = $column;
  6. }
  7. }
  8. }
  9. }
  1. private function getFrequentlyQueriedColumns(string $table): array
  2. {
  3. $columns = [];
  4. foreach ($this->slowQueries as $query) {
  5. if (in_array($table, $query['analysis']['tables_accessed'])) {
    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. $whereColumns = $this->extractWhereColumns($query['sql']);
  7. if (isset($whereColumns[$table])) {
  8. foreach ($whereColumns[$table] as $column) {
  9. if (!isset($columns[$column])) {
  10. $columns[$column] = 0;
  1. * @return bool True if index exists
  2. */
  3. private function hasIndexOnColumn(array $indexes, string $column): bool
  4. {
  5. foreach ($indexes as $index) {
  6. if (in_array($column, $index['columns'])) {
    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
  7. return true;
  8. }
  9. }
  10. return false;
  11. }
  1. if ($field === $idColumn) {
  2. return true;
  3. }
  4. // Exclude system timestamp fields
  5. if (in_array($field, ['created_at', 'updated_at', 'deleted_at'])) {
    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. return false;
  7. }
  8. // Get column type
  9. $type = $columnTypes[$field] ?? 'string';
  1. // Get column type
  2. $type = $columnTypes[$field] ?? 'string';
  3. // Include numeric columns (for aggregation)
  4. if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
    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. return true;
  6. }
  7. // Include date/timestamp columns (for temporal analysis)
  8. if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
  1. if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
  2. return true;
  3. }
  4. // Include date/timestamp columns (for temporal analysis)
  5. if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
    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. return true;
  7. }
  8. // Include text columns (for filtering and grouping)
  9. if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
  1. if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
  2. return true;
  3. }
  4. // Include text columns (for filtering and grouping)
  5. if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
    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. return true;
  7. }
  8. // Exclude everything else (binary, blob, json, etc.)
  9. return false;
  1. // Prefer 'normalized'; fall back to 'normalized_value' for forward-compat
  2. $scoreDescription = (float) ($factor['normalized'] ?? $factor['normalized_value'] ?? 0.0);
  3. }
  4. }
  5. $finalQuadrant = in_array($quadrant, ['Q1', 'Q2', 'Q3', 'Q4']) ? $quadrant : 'Q_intermediate';
    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. return [
  7. 'quadrant' => $finalQuadrant,
  8. 'score_x' => (float) ($scoreXResult['score'] ?? 0.0),
  9. 'score_y' => (float) ($scoreYResult['score'] ?? 0.0),
  1. $fields = DoctrineOrm::getTableColumns($tableName);
  2. // Exclude only ID and system timestamp fields
  3. return array_values(array_filter($fields, function($field) use ($idColumn) {
  4. return $field !== $idColumn
  5. && !in_array($field, ['created_at', 'updated_at', 'deleted_at']);
    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. }));
  7. } catch (\Exception $e) {
  8. return [];
  9. }
  1. $words = preg_split('/[\s,.:;!?"()]+/u', mb_strtolower($onlyText), -1, PREG_SPLIT_NO_EMPTY);
  2. $grammar = $this->grammar();
  3. $counts = [];
  4. foreach ($words as $w) {
  5. $w = preg_replace('/[^\p{L}\p{N}\-]/u', '', $w);
  6. if (mb_strlen($w) > 2 && !in_array($w, $grammar)) {
    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
  7. $counts[$w] = ($counts[$w] ?? 0) + 1;
  8. }
  9. }
  10. arsort($counts);
  11. $report['wordcountmax'] = array_slice($counts, 0, 8, true);
  1. $productData = $this->getProductData($productId);
  2. if ($productData && !$productData['in_stock']) {
  3. $messages[] = [
  4. 'type' => 'error',
  5. 'code' => 'out_of_stock',
  6. 'param' => '$.line_items[' . array_search($lineItem, $lineItems) . ']',
    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
  7. 'content_type' => 'plain',
  8. 'content' => 'Produit ' . $productData['title'] . ' temporairement indisponible'
  9. ];
  10. }
  11. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_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_ECOMMERCE_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_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_ECOMMERCE_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_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_ECOMMERCE_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_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_ECOMMERCE_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_ARCHIVE_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_PRODUCTS_ARCHIVE_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. // make sure no duplicate category IDs exist which could lock the server in a loop
  2. $tmp_array = [];
  3. $n = count($cPath_array);
  4. for ($i = 0; $i < $n; $i++) {
  5. if (!in_array($cPath_array[$i], $tmp_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
  6. $tmp_array[] = $cPath_array[$i];
  7. }
  8. }
  9. return $tmp_array;
  1. $category_name = $this->getCategoryTreeTitle($category['name']);
  2. $categories_url = $this->getCategoryTreeUrl($category_link);
  3. if (($this->follow_cpath === true) && in_array($category_id, $this->cpath_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
  4. $link_title = $this->cpath_start_string . $category_name . $this->cpath_end_string;
  5. } else {
  6. $link_title = $category_name;
  7. }
  1. $result .= $this->parent_end_string;
  2. }
  3. if (isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
  4. if ($this->follow_cpath === true) {
  5. if (in_array($category_id, $this->cpath_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
  6. $result .= $this->_buildBranch($category_id, $level + 1);
  7. }
  8. } else {
  9. $result .= $this->_buildBranch($category_id, $level + 1);
  10. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_CATEGORIES_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_PRODUCTS_CATEGORIES_INSTALLED', implode(';', $installed));
  1. $categories_id = HTML::sanitize($this->Id);
  2. $new_parent_id = HTML::sanitize($this->moveToCategoryID);
  3. $path = explode('_', $this->categoriesAdmin->getGeneratedCategoryPathIds($new_parent_id));
  4. if (\in_array($this->Id, $path)) {
    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. $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
  6. $this->app->redirect('Categories&cPath=' . $this->cPath . '&cID=' . $categories_id);
  7. } else {
  8. $sql_array = [
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MANUFACTURERS_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_MANUFACTURERS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CATALOG_PRODUCTS_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_CATALOG_PRODUCTS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_ATTRIBUTES_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_PRODUCTS_ATTRIBUTES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SUPPLIERS_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_SUPPLIERS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_EMAIL_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_EMAIL_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_NEWSLETTER_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_NEWSLETTER_INSTALLED', implode(';', $installed));
  1. } else {
  2. $chosen = [];
  3. foreach ($_POST['chosen'] as $id) {
  4. if (is_numeric($id) && !\in_array($id, $chosen)) {
    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. $chosen[] = $id;
  6. }
  7. }
  8. $ids = array_map(function ($k) {
  1. }
  2. } else {
  3. $chosen = [];
  4. foreach ($_POST['chosen'] as $id) {
  5. if (is_numeric($id) && !\in_array($id, $chosen)) {
    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. $chosen[] = $id;
  7. }
  8. }
  9. $ids = array_map(function ($k) {
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. $allowed = array_map(function ($v) {
  2. return basename($v, '.php');
  3. }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
  4. if (!\in_array($newsletter_module, $allowed)) {
    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. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
  6. $newsletter_error = true;
  7. }
  8. if ($newsletters_accept_file == 'on') {
  1. $allowed = array_map(function ($v) {
  2. return basename($v, '.php');
  3. }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
  4. if (!\in_array($newsletter_module, $allowed)) {
    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. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
  6. $newsletter_error = true;
  7. }
  8. if ($newsletters_accept_file == 'on') {
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PAGE_MANAGER_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_PAGE_MANAGER_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ADMINISTRATORS_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_ADMINISTRATORS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. foreach ($Qips as $allowedIp) {
  2. $ip = $allowedIp['ip'];
  3. if ($ip === '127.0.0.1' || $ip === 'localhost') {
  4. if (in_array($clientIp, ['127.0.0.1', '::1'])) {
    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. self::logSecurityEvent('Localhost access granted', [
  6. 'api_id' => $api_id,
  7. 'client_ip' => $clientIp
  8. ]);
  1. */
  2. public static function isLocalEnvironment(): bool
  3. {
  4. $ip = HTTP::getIpAddress();
  5. if (in_array($ip, ['127.0.0.1', '::1'])) {
    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. return true;
  7. }
  8. $serverName = $_SERVER['SERVER_NAME'] ?? '';
  9. $host = $_SERVER['HTTP_HOST'] ?? '';
  1. }
  2. $method = strtoupper($_SERVER["REQUEST_METHOD"]);
  3. $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
  4. if (!in_array($method, $allowedMethods)) {
    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. throw new Exception("Invalid HTTP method: " . $method);
  6. }
  7. return $method;
  8. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_API_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_API_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CACHE_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_CACHE_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. foreach ($models as $model) {
  2. $modelId = $model['id'];
  3. $provider = $model['provider'] ?? 'openai'; // Default to openai if missing
  4. // Validate provider name
  5. if (!in_array($provider, $validProviders)) {
    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. if (defined('CLICSHOPPING_APP_CHATGPT_CH_DEBUG') && CLICSHOPPING_APP_CHATGPT_CH_DEBUG === 'True') {
  7. error_log("WARNING: Invalid provider '$provider' for model '$modelId'. Using 'openai' as default.");
  8. }
  9. $provider = 'openai';
  10. }
  1. 'open-mistral-nemo',
  2. 'open-codestral-mamba',
  3. 'mistral-moderation-latest'
  4. ];
  5. if (empty($model) || !in_array($model, $valid_models)) {
    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. $model = 'mistral-large-latest';
  7. }
  8. $config = new MistralAIChat();
  9. $config->apiKey = $api_key;
  1. }
  2. // Validate type is one of expected values
  3. if (isset($response['type'])) {
  4. $validTypes = ['analytics', 'semantic', 'web_search', 'hybrid', 'error', 'clarification'];
  5. if (!in_array($response['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. $warnings[] = "Unexpected type value: {$response['type']}";
  7. }
  8. }
  9. return [
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_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_CHATGPT_INSTALLED', implode(';', $installed));
  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. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_COUNTRIES_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_COUNTRIES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CURRENCY_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_CURRENCY_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_LANGUES_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_LANGUES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. }
  2. foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
  3. $code = basename($dir);
  4. if (array_search($code, array_column($directories, 'id')) === false) {
    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
  5. $directories[] = ['id' => $code,
  6. 'text' => $code
  7. ];
  8. }
  9. }
  1. }
  2. foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
  3. $code = basename($dir);
  4. if (array_search($code, array_column($directories, 'id')) === false) {
    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
  5. $directories[] = ['id' => $code,
  6. 'text' => $code
  7. ];
  8. }
  9. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MODULES_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_MODULES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. $module->install();
  2. $modules_installed = explode(';', \constant($module_key));
  3. if (!\in_array($class . $file_extension, $modules_installed)) {
    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
  4. $modules_installed[] = $class . $file_extension;
  5. }
  6. Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
  7. ['configuration_key' => $module_key]
  1. $module->remove();
  2. $modules_installed = explode(';', \constant($module_key));
  3. if (\in_array($class . $file_extension, $modules_installed)) {
    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
  4. unset($modules_installed[array_search($class . $file_extension, $modules_installed)]);
  5. }
  6. Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
  7. ['configuration_key' => $module_key]
  1. $module->remove();
  2. $modules_installed = explode(';', \constant($module_key));
  3. if (\in_array($class . $file_extension, $modules_installed)) {
  4. unset($modules_installed[array_search($class . $file_extension, $modules_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
  5. }
  6. Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
  7. ['configuration_key' => $module_key]
  8. );
  1. if ($dir = @dir($module_directory)) {
  2. while ($file = $dir->read()) {
  3. if (!is_dir($module_directory . $file)) {
  4. if (substr($file, strrpos($file, '.')) == $file_extension) {
  5. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  6. if (!\in_array($file, $modules_installed)) {
    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
  7. $directory_array[] = $file;
  8. }
  9. } else {
  10. if (\in_array($file, $modules_installed)) {
  11. $directory_array[] = $file;
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($file, $modules_installed)) {
  3. $directory_array[] = $file;
  4. }
  5. } else {
  6. if (\in_array($file, $modules_installed)) {
    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
  7. $directory_array[] = $file;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  1. }
  2. if (isset($appModuleType)) {
  3. foreach (Apps::getModules($appModuleType) as $k => $v) {
  4. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  5. if (!\in_array($k, $modules_installed)) {
    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. $directory_array[] = $k;
  7. }
  8. } else {
  9. if (\in_array($k, $modules_installed)) {
  10. $directory_array[] = $k;
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($k, $modules_installed)) {
  3. $directory_array[] = $k;
  4. }
  5. } else {
  6. if (\in_array($k, $modules_installed)) {
    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
  7. $directory_array[] = $k;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  1. if ($dir = @dir($module_directory)) {
  2. while ($file = $dir->read()) {
  3. if (!is_dir($module_directory . $file)) {
  4. if (substr($file, strrpos($file, '.')) === $file_extension) {
  5. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  6. if (!\in_array($file, $modules_installed)) {
    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
  7. $directory_array[] = $file;
  8. }
  9. } else {
  10. if (\in_array($file, $modules_installed)) {
  11. $directory_array[] = $file;
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($file, $modules_installed)) {
  3. $directory_array[] = $file;
  4. }
  5. } else {
  6. if (\in_array($file, $modules_installed)) {
    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
  7. $directory_array[] = $file;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  1. }
  2. if (isset($appModuleType)) {
  3. foreach (Apps::getModules($appModuleType) as $k => $v) {
  4. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  5. if (!\in_array($k, $modules_installed)) {
    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. $directory_array[] = $k;
  7. }
  8. } else {
  9. if (\in_array($k, $modules_installed)) {
  10. $directory_array[] = $k;
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($k, $modules_installed)) {
  3. $directory_array[] = $k;
  4. }
  5. } else {
  6. if (\in_array($k, $modules_installed)) {
    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
  7. $directory_array[] = $k;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  1. <tr>
  2. <td><?php echo $module->title; ?></td>
  3. <td class="text-start"><?php echo $module->group; ?></td>
  4. <td class="text-end">
  5. <?php
  6. if (\in_array($module->code . $file_extension, $modules_installed) && is_numeric($module->sort_order)) {
    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
  7. echo $module->sort_order;
  8. }
  9. ?>
  10. </td>
  11. <td class="text-center">
  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),
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_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_ORDERS_STATUS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_INVOICE_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_ORDERS_STATUS_INVOICE_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PROUCTS_LENGTH_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_PROUCTS_LENGTH_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_QUANTITY_UNIT_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_PRODUCTS_QUANTITY_UNIT_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SETTINGS_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_SETTINGS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TAX_CLASS_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_TAX_CLASS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TAX_GEO_ZONES_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_TAX_GEO_ZONES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TAX_RATES_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_TAX_RATES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TEMPLATE_EMAIL_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_TEMPLATE_EMAIL_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_WEIGHT_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_WEIGHT_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ZONES_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_ZONES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_INFO_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_CUSTOMERS_INFO_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_GDPR_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_CUSTOMERS_GDPR_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_GROUPS_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_CUSTOMERS_GROUPS_INSTALLED', implode(';', $installed));
  1. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  2. if (str_contains($include_modules[$i]['class'], '\\')) {
  3. Registry::set('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  4. $module = Registry::get('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']));
  5. if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $payments_unallowed))) {
    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. $content .= '<div class="row">';
  7. $content .= '<div class="col-md-5">';
  8. $content .= '<div class="form-group row">';
  9. $content .= '<div class="col-md-12">';
  10. $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
  1. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  2. if (str_contains($include_modules[$i]['class'], '\\')) {
  3. Registry::set('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  4. $module = Registry::get('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']));
  5. if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
    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. $content .= '<div class="col-md-12">';
  7. $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
  8. $content .= '<span class="col-md-3">' . $module->title . '</span>';
  9. $content .= '</div>';
  10. } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
  1. if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
  2. $content .= '<div class="col-md-12">';
  3. $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
  4. $content .= '<span class="col-md-3">' . $module->title . '</span>';
  5. $content .= '</div>';
  6. } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
    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
  7. $content .= '<div class="col-md-12">';
  8. $content .= '<span class="col-md-1"><i class="bi-check text-danger"></i></span>';
  9. $content .= '<span class="col-md-3">' . $module->title . '</span>';
  10. $content .= '</div>';
  11. } elseif ($cInfo->customers_group_id == 0) {
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. <div class="form-group row">
  2. <div class="col-md-12">
  3. <ul class="list-group-slider list-group-flush">
  4. <li class="list-group-item-slider">
  5. <label class="switch">
  6. <?php echo HTML::checkboxField('payment_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $payments_unallowed)) ? true : false, 'class="success"'); ?>
    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
  7. <span class="slider"></span>
  8. </label>
  9. </li>
  10. <span class="text-slider"><?php echo $module->title; ?></span>
  11. </ul>
  1. <div class="form-group row">
  2. <div class="col-md-12">
  3. <ul class="list-group-slider list-group-flush">
  4. <li class="list-group-item-slider">
  5. <label class="switch">
  6. <?php echo HTML::checkboxField('shipping_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $shipping_unallowed)) ? true : false, 'class="success"'); ?>
    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
  7. <span class="slider"></span>
  8. </label>
  9. </li>
  10. <span class="text-slider"><?php echo $module->title; ?></span>
  11. </ul>
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_MEMBERS_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_CUSTOMERS_MEMBERS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_REVIEWS_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_REVIEWS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_BANNER_MANAGER_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_BANNER_MANAGER_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_FAVORITES_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_PRODUCTS_FAVORITES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_FEATURED_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_PRODUCTS_FEATURED_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_PRODUCT_RECOMMENDATIONS_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_PRODUCTS_PRODUCT_RECOMMENDATIONS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SEO_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_SEO_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_SPECIALS_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_PRODUCTS_SPECIALS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_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_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_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_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_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_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_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_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ORDERS_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_ORDERS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_RETURN_ORDERS_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_PRODUCTS_RETURN_ORDERS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_PAYMENT_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_PAYMENT_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_PAYMENT_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_PAYMENT_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_PAYMENT_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_PAYMENT_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_STATS_PRODUCTS_NOTIFICATION_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_STATS_PRODUCTS_NOTIFICATION_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_SHIPPING_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_SHIPPING_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_SHIPPING_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_SHIPPING_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. $CLICSHOPPING_Language = Registry::get('Language');
  2. $module = HTML::sanitize(str_replace(' ', '', $module));
  3. if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
  4. if (!is_null($module) && in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
    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. if (!class_exists($module)) {
  6. if (is_file($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
  7. $CLICSHOPPING_Language->loadDefinitions('modules/action_recorder/' . $module);
  8. include($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)));
  9. } else {
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ACTIONS_RECORDER_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_ACTIONS_RECORDER_INSTALLED', implode(';', $installed));
  1. $modules_array[] = $Qmodules->value('module');
  2. }
  3. $expired_entries = 0;
  4. if (isset($_GET['module']) && \in_array($_GET['module'], $modules_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. $get_module_class = $CLICSHOPPING_ActionsRecorderClass->getClassModule($_GET['module']);
  6. if (\is_object($get_module_class)) {
  7. $expired_entries += $get_module_class->expireEntries();
  8. } else {
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. echo HTML::form('search', $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder'), 'post', '', ['session_id' => true]);
  2. echo HTML::selectField('module', $modules_list_array, null, 'onchange="this.form.submit();"');
  3. ?>
  4. </span>
  5. <span class="col-md-1 text-end">
  6. <?php echo HTML::button($CLICSHOPPING_ActionsRecorder->getDef('button_reset'), null, $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder&Expire' . (isset($_POST['module']) && \in_array($_POST['module'], $modules_array) ? '&module=' . $_POST['module'] : '')), 'danger'); ?>
    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
  7. </span>
  8. </div>
  9. </form>
  10. </div>
  11. </div>
  1. </thead>
  2. <tbody>
  3. <?php
  4. $filter = [];
  5. if (isset($_POST['module']) && \in_array($_POST['module'], $modules_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
  6. $filter[] = 'module = :module';
  7. }
  8. if (isset($_POST['search']) && !empty($_POST['search'])) {
  9. $filter[] = 'identifier like :identifier';
  1. $sql_query .= ' order by date_added desc limit :page_set_offset, :page_set_max_results';
  2. $Qactions = $CLICSHOPPING_ActionsRecorder->db->prepare($sql_query);
  3. if (!empty($filter)) {
  4. if (isset($_POST['module']) && \in_array($_POST['module'], $modules_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. $Qactions->bindValue(':module', $_POST['module']);
  6. }
  7. if (isset($_POST['search']) && !empty($_POST['search'])) {
  8. $Qactions->bindValue(':identifier', '%' . $_POST['search'] . '%');
  1. <div class="row">
  2. <div class="col-md-12">
  3. <div
  4. class="col-md-6 float-start pagenumber hidden-xs TextDisplayNumberOfLink"><?php echo $Qactions->getPageSetLabel($CLICSHOPPING_ActionsRecorder->getDef('text_display_number_of_link')); ?></div>
  5. <div
  6. class="float-end text-end"> <?php echo $Qactions->getPageSetLinks((isset($_POST['module']) && \in_array($_POST['module'], $modules_array) && \is_object($GLOBALS[$_POST['module']]) ? 'module=' . $_POST['module'] : null) . '&' . (isset($_POST['search']) && !empty($_POST['search']) ? 'search=' . $_POST['search'] : null)); ?></div>
    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
  7. </div>
  8. </div>
  9. </div>
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ADMINISTRATOR_MENU_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_ADMINISTRATOR_MENU_INSTALLED', implode(';', $installed));
  1. if (isset($this->Id) && ($this->Id != $this->moveToCategoryID)) {
  2. $new_parent_id = $this->moveToCategoryID;
  3. $path = explode('_', AdministratorMenu::getGeneratedAdministratorMenuPathIds($new_parent_id));
  4. if (\in_array($this->Id, $path)) {
    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. $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
  6. $this->app->redirect('AdministratorMenu&cPath=' . (int)$this->cPath . '&cID=' . (int)$this->Id);
  7. } else {
  8. $this->app->db->save('administrator_menu', [
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_APPS_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_APPS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_BACKUP_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_BACKUP_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. $dir = dir($backup_directory);
  2. $contents = [];
  3. while ($file = $dir->read()) {
  4. if (!is_dir($backup_directory . $file) && \in_array(substr($file, -3), array('zip', 'sql', '.gz'))) {
    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. $contents[] = $file;
  6. }
  7. }
  8. sort($contents);
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CRONJOB_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_CRONJOB_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_DATA_BASE_TABLES_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_DATA_BASE_TABLES_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. ['id' => 'utf8',
  2. 'text' => $CLICSHOPPING_DataBaseTables->getDef('action_utf8_conversion')
  3. ]);
  4. if (isset($_POST['action'])) {
  5. if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
    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. if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
  7. $tables = Database::getDtTables();
  8. foreach ($_POST['id'] as $key => $value) {
  9. if (!\in_array($value, $tables)) {
  1. if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
  2. if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
  3. $tables = Database::getDtTables();
  4. foreach ($_POST['id'] as $key => $value) {
  5. if (!\in_array($value, $tables)) {
    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. unset($_POST['id'][$key]);
  7. }
  8. }
  9. if (!empty($_POST['id'])) {
  1. while ($Qaction->fetch()) {
  2. $table_data[] = [
  3. ($table != $current_table) ? HTML::outputProtected($table) : '',
  4. $Qaction->valueProtected('Msg_type'),
  5. $Qaction->valueProtected('Msg_text'),
  6. ($table != $current_table) ? HTML::checkboxField('id[]', $table, isset($_POST['id']) && \in_array($table, $_POST['id'])) : ''
    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
  7. ];
  8. $current_table = $table;
  9. }
  10. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_DEFINE_LANGUAGE_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_DEFINE_LANGUAGE_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory_selected));
  2. foreach ($file_array as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    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. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  1. $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($filename_selected));
  2. foreach ($file_array as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    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. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  1. $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($template_directory));
  2. foreach ($file_array as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    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. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  1. /* if empty error is produced : Fatal error: Uncaught exception 'RuntimeException'*/
  2. foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($template_directory)) as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && \in_array($fileInfo['extension'], $fileTypes)) {
    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. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_EDIT_DESIGN_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_EDIT_DESIGN_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_EDIT_LOG_ERROR_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_EDIT_LOG_ERROR_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. * @param array $checks An array of check results, each with a 'status' key.
  2. * @return string The overall status: 'error', 'warning', or 'healthy'.
  3. */
  4. private function determineOverallStatus(array $checks): string
  5. {
  6. if (in_array('error', array_column($checks, 'status'))) {
    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
  7. return 'error';
  8. }
  9. if (in_array('warning', array_column($checks, 'status'))) {
  10. return 'warning';
  11. }
  1. private function determineOverallStatus(array $checks): string
  2. {
  3. if (in_array('error', array_column($checks, 'status'))) {
  4. return 'error';
  5. }
  6. if (in_array('warning', array_column($checks, 'status'))) {
    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
  7. return 'warning';
  8. }
  9. return 'healthy';
  10. }
  1. }
  2. // Accepter les codes 200, 404 (si /health n'existe pas), ou 405 (méthode non supportée)
  3. $acceptableCodes = [200, 404, 405];
  4. if (!in_array($httpCode, $acceptableCodes)) {
    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. $this->logger->error('HTTP connection test failed', [
  6. 'http_code' => $httpCode,
  7. 'response' => $response,
  8. 'url' => $healthUrl
  9. ]);
  1. foreach ($Qips as $allowedIp) {
  2. $ip = $allowedIp['ip'];
  3. if ($ip === '127.0.0.1' || $ip === 'localhost') {
  4. if (in_array($clientIp, ['127.0.0.1', '::1'])) {
    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. self::logSecurityEvent('Localhost access granted', [
  6. 'mcp_id' => $mcp_id,
  7. 'client_ip' => $clientIp
  8. ]);
  1. */
  2. public static function isLocalEnvironment(): bool
  3. {
  4. $ip = HTTP::getIpAddress();
  5. if (in_array($ip, ['127.0.0.1', '::1'])) {
    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. return true;
  7. }
  8. $serverName = $_SERVER['SERVER_NAME'] ?? '';
  9. $host = $_SERVER['HTTP_HOST'] ?? '';
  1. }
  2. $method = strtoupper($_SERVER["REQUEST_METHOD"]);
  3. $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
  4. if (!in_array($method, $allowedMethods)) {
    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. throw new Exception("Invalid HTTP method: " . $method);
  6. }
  7. return $method;
  8. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MCP_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_MCP_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. /**
  2. * Valide une clé d'API pour un niveau d'accès donné
  3. */
  4. public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
  5. if (!in_array($accessLevel, $this->accessLevels)) {
    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. return false;
  7. }
  8. if (!isset($this->validMcpKeys[$accessLevel])) {
  9. return false;
  1. if (!isset($this->validMcpKeys[$accessLevel])) {
  2. return false;
  3. }
  4. return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
    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. }
  6. /**
  7. * Valide les headers de sécurité requis
  8. */
  1. 'ssl_enabled' => $sslEnabled,
  2. 'origin' => $origin
  3. ];
  4. // Add to allowed origins list
  5. if (!in_array($origin, $this->allowedOrigins)) {
    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. $this->allowedOrigins[] = $origin;
  7. }
  8. }
  9. // Fallback to localhost if no configurations found
  1. /**
  2. * Check if an origin is allowed
  3. */
  4. public function isOriginAllowed(string $origin): bool {
  5. return in_array($origin, $this->allowedOrigins);
    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. }
  7. /**
  8. * Valide une clé d'API pour un niveau d'accès donné
  9. */
  1. /**
  2. * Valide une clé d'API pour un niveau d'accès donné
  3. */
  4. public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
  5. if (!in_array($accessLevel, $this->accessLevels)) {
    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. return false;
  7. }
  8. if (!isset($this->validMcpKeys[$accessLevel])) {
  9. return false;
  1. if (!isset($this->validMcpKeys[$accessLevel])) {
  2. return false;
  3. }
  4. return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
    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. }
  6. /**
  7. * Valide les headers de sécurité requis
  8. */
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MODULES_HOOKS_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_MODULES_HOOKS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SEC_DIR_PERMISSIONS_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_SEC_DIR_PERMISSIONS_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. if ($handle = opendir($path)) {
  2. while (false !== ($filename = readdir($handle))) {
  3. if (!\in_array($filename, $exclude_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
  4. $file = ['name' => $path . $filename,
  5. 'is_dir' => is_dir($path . $filename),
  6. 'writable' => FileSystem::isWritable($path . $filename)
  7. ];
  1. <th
  2. scope="row"><?php echo substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))); ?></th>
  3. <td
  4. class="text-center"><?php echo $file['writable'] === true ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'; ?></td>
  5. <td
  6. class="text-center"><?php echo(\in_array(substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))), $whitelist_array) ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'); ?></td>
    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
  7. </tr>
  8. <?php
  9. }
  10. }
  11. ?>
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SECURITY_CHECK_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_SECURITY_CHECK_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. <?php
  2. foreach ($modules as $module) {
  3. $secCheck = $GLOBALS[$module['class']];
  4. if (!\in_array($secCheck->type, $types)) {
    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. $secCheck->type = 'info';
  6. }
  7. $output = '';
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SERVICE_APP_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_SERVICE_APP_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_UPGRADE_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_UPGRADE_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_WHOS_ONLINE_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_WHOS_ONLINE_INSTALLED', implode(';', $installed));
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    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. }
  7. }
  1. continue;
  2. }
  3. $fullClass = self::NAMESPACE_PREFIX . $fileInfo->getBasename('.php');
  4. if (class_exists($fullClass) && in_array(ActionToolsInterface::class, class_implements($fullClass))) {
    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. try {
  6. /** @var ActionToolsInterface $toolInstance */
  7. $toolInstance = new $fullClass();
  8. $toolName = $toolInstance->getName();
  9. $this->tools[$toolName] = $fullClass;
  1. $details_string = preg_replace('/comment\(.+\)$/', '', $details_string);
  2. $details = array_filter(explode(' ', $details_string), fn($v) => $v !== null && $v !== '');
  3. $details = array_values($details);
  4. }
  5. $is_binary = array_search('binary', $details);
    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 (is_int($is_binary)) {
  7. array_splice($details, $is_binary, 1);
  8. $schema['col'][$field_name]['binary'] = true;
  9. }
  1. if (is_int($is_binary)) {
  2. array_splice($details, $is_binary, 1);
  3. $schema['col'][$field_name]['binary'] = true;
  4. }
  5. $is_unsigned = array_search('unsigned', $details);
    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 (is_int($is_unsigned)) {
  7. array_splice($details, $is_unsigned, 1);
  8. $schema['col'][$field_name]['unsigned'] = true;
  9. }
  1. if (is_int($is_unsigned)) {
  2. array_splice($details, $is_unsigned, 1);
  3. $schema['col'][$field_name]['unsigned'] = true;
  4. }
  5. $is_not_null = array_search('not_null', $details);
    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 (is_int($is_not_null)) {
  7. array_splice($details, $is_not_null, 1);
  8. $schema['col'][$field_name]['not_null'] = true;
  9. }
  1. if (is_int($is_not_null)) {
  2. array_splice($details, $is_not_null, 1);
  3. $schema['col'][$field_name]['not_null'] = true;
  4. }
  5. $is_auto_increment = array_search('auto_increment', $details);
    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 (preg_match('/on_update\(([^)]+)\)/', $details_string, $on_update_match)) {
  7. $schema['col'][$field_name]['on_update'] = $on_update_match[1];
  8. $details_string = preg_replace('/on_update\([^)]+\)/', '', $details_string);
  9. $details = array_values(array_filter(explode(' ', $details_string)));
  1. $this->result = $this->cache_data;
  2. } else {
  3. $fetch_argument = $args[0] ?? null;
  4. $ctor_args = $args[1] ?? [];
  5. if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
    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. $this->result = parent::fetchAll($fetch_style, $fetch_argument);
  7. } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
  8. $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
  9. } else {
  10. $this->result = parent::fetchAll($fetch_style);
  1. $fetch_argument = $args[0] ?? null;
  2. $ctor_args = $args[1] ?? [];
  3. if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
  4. $this->result = parent::fetchAll($fetch_style, $fetch_argument);
  5. } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
    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. $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
  7. } else {
  8. $this->result = parent::fetchAll($fetch_style);
  9. }
  1. */
  2. public function setExcludeEntries(?array $entries)
  3. {
  4. if (is_array($entries)) {
  5. foreach ($entries as $value) {
  6. if (!in_array($value, $this->exclude_entries)) {
    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
  7. $this->exclude_entries[] = $value;
  8. }
  9. }
  10. } elseif (is_string($entries)) {
  11. if (!in_array($entries, $this->exclude_entries)) {
  1. if (!in_array($value, $this->exclude_entries)) {
  2. $this->exclude_entries[] = $value;
  3. }
  4. }
  5. } elseif (is_string($entries)) {
  6. if (!in_array($entries, $this->exclude_entries)) {
    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
  7. $this->exclude_entries[] = $entries;
  8. }
  9. }
  10. }
  1. $this->listing = array();
  2. }
  3. if ($dir = @dir($directory)) {
  4. while (($entry = $dir->read()) !== false) {
  5. if (!in_array($entry, $this->exclude_entries)) {
    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. if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
  7. if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
  8. if ($this->adddirectory_to_filename === true) {
  9. if ($dir->path !== $this->directory) {
  10. $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
  1. if ($dir = @dir($directory)) {
  2. while (($entry = $dir->read()) !== false) {
  3. if (!in_array($entry, $this->exclude_entries)) {
  4. if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
  5. if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
    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. if ($this->adddirectory_to_filename === true) {
  7. if ($dir->path !== $this->directory) {
  8. $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
  9. }
  10. }
  1. * @param string $type The type of the module to check for.
  2. * @return bool Returns true if the module exists, false otherwise.
  3. */
  4. final public function hasModule(string $module, string $type): bool
  5. {
  6. return isset($this->modules[$type]) && in_array($module, $this->modules[$type]);
    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
  7. }
  8. /**
  9. * Sets the app information by reflecting the current class and loading data
  10. * from a metafile. Assigns the app's code, vendor, title, version, and modules
  1. $field .= ' id="' . static::output(substr($parameters, $offset + 4, strpos($parameters, '"', $offset + 4) - ($offset + 4))) . '_' . $counter . '"';
  2. }
  3. $field .= ' value="' . static::output($selection_value) . '"';
  4. if (isset($default) && (($default === true) || (!is_array($default) && ((string)$default == (string)$selection_value)) || (is_array($default) && in_array($selection_value, $default)))) {
    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. $field .= ' checked="checked"';
  6. }
  7. if (!empty($parameters)) {
  8. $field .= ' ' . $parameters;
  1. if (!isset($params['type'])) {
  2. $params['type'] = 'submit';
  3. }
  4. if (!in_array($params['type'], $types)) {
    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. $params['type'] = 'submit';
  6. }
  7. if (($params['type'] == 'submit') && isset($link)) {
  8. $params['type'] = 'button';
  1. if (($params['type'] == 'submit') && isset($link)) {
  2. $params['type'] = 'button';
  3. }
  4. if (isset($style) && !in_array($style, $styles)) {
    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. unset($style);
  6. }
  7. if (isset($size) && !in_array($size, $size_button)) {
  8. unset($size);
  1. if (isset($style) && !in_array($style, $styles)) {
  2. unset($style);
  3. }
  4. if (isset($size) && !in_array($size, $size_button)) {
    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. unset($size);
  6. }
  7. $button = '';
  1. if (!isset($data['cafile'])) {
  2. $data['cafile'] = CLICSHOPPING::BASE_DIR . 'External/cacert.pem';
  3. }
  4. if (isset($data['format']) && !in_array($data['format'], ['json'])) {
    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. trigger_error('HttpRequest::getResponse(): Unknown "format": ' . $data['format']);
  6. unset($data['format']);
  7. }
  1. ];
  2. $domain = strtolower(substr(strrchr($email, "@"), 1));
  3. if (in_array($domain, $temp_domains)) {
    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
  4. return true;
  5. }
  6. }
  7. return false;
  1. $stack = [
  2. 'text' => $message,
  3. 'type' => $type
  4. ];
  5. if (!$this->exists($group) || !in_array($stack, $this->data[$group])) {
    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. $this->data[$group][] = $stack;
  7. }
  8. }
  9. /**
  1. }
  2. }
  3. if (!empty($this->_upload)) {
  4. if (!empty($this->_extensions)) {
  5. if (!in_array(mb_strtolower(substr($this->_upload['name'], strrpos($this->_upload['name'], '.') + 1)), $this->_extensions)) {
    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. $CLICSHOPPING_MessageStack->add(CLICSHOPPING::getDef('error_filetype_not_allowed') . implode(', ', $this->_extensions), 'warning');
  7. return false;
  8. }
  9. }
  1. public function isInstalled()
  2. {
  3. $module = HTML::sanitize(str_replace(' ', '', $this->_module));
  4. if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
  5. if (!is_null($module) && \in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
    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. if (!class_exists($module)) {
  7. if (is_file(CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Core/modules/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
  8. $this->lang->loadDefinitions('Shop/Module/ActionRecorder/' . $module);
  1. $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
  2. foreach ($contents as $item) {
  3. $fileInfo = pathinfo($item);
  4. if (array_key_exists('extension', $fileInfo) && \in_array($fileInfo['extension'], $fileTypes)) {
    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. $found[] = $item;
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  1. sort($select_array);
  2. $values_array = explode(';', $values);
  3. $output = '';
  4. foreach ($select_array as $file) {
  5. $output .= HTML::checkboxField('ht_datepicker_jquery_file[]', $file, \in_array($file, $values_array)) . '&nbsp;' . HTML::outputProtected($file) . '<br />';
    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. }
  7. if (!empty($output)) {
  8. $output = '<br />' . substr($output, 0, -6);
  9. }
  1. */
  2. public static function checkExecEnabled(): bool
  3. {
  4. $disabled = explode(', ', ini_get('disable_functions'));
  5. return !in_array('exec', $disabled);
    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. }
  7. /**
  8. * Checks if Composer is installed and accessible in the current environment.
  9. *
  1. $Qproducts->bindInt(':language_id', (int)$CLICSHOPPING_Language->getId());
  2. $Qproducts->execute();
  3. while ($Qproducts->fetch()) {
  4. if (MODE_B2B_B2C == 'True') {
  5. if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
    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. $Qprice = $CLICSHOPPING_Db->prepare('select customers_group_price,
  7. customers_group_id
  8. from :table_products_groups
  9. where products_id = :products_id
  1. $price_string = '';
  2. $sde = 0;
  3. //while(list($sdek,$sdev)=each($all_groups)){
  4. foreach ($all_groups as $sdek => $sdev) {
  5. if (!in_array($Qproducts->valueInt('products_id') . ":" . (int)$sdek, $exclude)) {
    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. if ($sde)
  7. $price_string .= ' - ';
  8. $price_string .= $sdev . ' : ' . $CLICSHOPPING_Currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek] : $Qproducts->valueDecimal('products_price'));
  9. $sde = 1;
  10. }
  1. // Ajouter VISITOR_NAME . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) pour permettre d'afficher le prix des clients qui ne font pas partie d'un groupe B2B(
  2. $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . CLICSHOPPING::getDef('visitor_name') . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ' - ' . $price_string . ')</option>';
  3. }
  4. } else {
  5. if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
    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. $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ')</option>';
  7. }
  8. }
  9. // ####### END #######
  1. {
  2. if (is_dir($source) === true) {
  3. $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::CHILD_FIRST);
  4. foreach ($files as $file) {
  5. if (in_array($file->getBasename(), array('.', '..')) !== true) {
    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. if ($file->isDir() === true) {
  7. rmdir($file->getPathName());
  8. } elseif (($file->isFile() === true) || ($file->isLink() === true)) {
  9. unlink($file->getPathname());
  10. }
  1. $fileTypes = ['php']; // Create an array of file types
  2. $found = []; // Traverse the folder, and add filename to $found array if type matches
  3. foreach ($contents as $item) {
  4. $fileInfo = pathinfo($item);
  5. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    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. $found[] = $item;
  7. }
  8. }
  9. if ($found) { // Check the $found array is not empty
  1. $QpaymentsNotAllowed->execute();
  2. $payments_not_allowed = $QpaymentsNotAllowed->fetch();
  3. $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
  4. $clearance = (in_array($pay_check, $payments_unallowed)) ? true : false;
    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. } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
  6. $clearance = true;
  7. } else {
  8. $clearance = false;
  1. $Qpayments->execute();
  2. $payments_not_allowed = $Qpayments->fetch();
  3. $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
  4. $clearance = (!in_array($pay_check, $payments_unallowed)) ? true : false;
    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. return $clearance;
  6. }
  7. }
  1. $QshippingNotAllowed->execute();
  2. $shipping_not_allowed = $QshippingNotAllowed->fetch();
  3. $shipping_unallowed = explode(",", $shipping_not_allowed['group_shipping_unallowed']);
  4. $shipping_clearance = (in_array($shipping_check, $shipping_unallowed)) ? true : false;
    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. } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
  6. $shipping_clearance = true;
  7. } else {
  8. $shipping_clearance = false;
  9. }
  1. $shipping_not_allowed = $Qshipping->fetch();
  2. if (!empty($shipping_not_allowed['group_payment_unallowed'])) {
  3. $shipping_unallowed = explode(',', $shipping_not_allowed['group_payment_unallowed']);
  4. $shipping_clearance = (!in_array($shipping_check, $shipping_unallowed)) ? true : false;
    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. } else {
  6. $shipping_clearance = false;
  7. }
  8. return $shipping_clearance;
  1. $string = '';
  2. if (is_array($array) && !empty($array)) {
  3. foreach ($array as $key => $value) {
  4. if (!in_array($key, $exclude)) {
    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. $string .= $key . '=' . $value . '&';
  6. }
  7. }
  8. $string = substr($string, 0, -1);
  1. $Qglobal->execute();
  2. $global = $Qglobal->fetch();
  3. if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] === $_SESSION['sessiontoken'])) {
  4. if (isset($_POST['product_global']) && is_numeric($_POST['product_global']) && in_array($_POST['product_global'], ['0', '1'])) {
    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. $product_global = (int)$_POST['product_global'];
  6. } else {
  7. $product_global = 0;
  8. }
  1. } elseif (count($products) > 0) {
  2. $products_parsed = [];
  3. foreach ($products as $value) {
  4. if (is_numeric($value) && !in_array($value, $products_parsed)) {
    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. $products_parsed[] = $value;
  6. }
  7. }
  8. if (count($products_parsed) > 0) {
  1. if (defined('MODULE_PAYMENT_INSTALLED') && !is_null(MODULE_PAYMENT_INSTALLED)) {
  2. $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
  3. $include_modules = [];
  4. if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
    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. $this->selected_module = $module;
  6. if (str_contains($module, '\\')) {
  7. $class = Apps::getModuleClass($module, 'Payment');
  1. if (($this->getCountPaymentModules() == 1) && (!isset($_SESSION['payment']) || ($_SESSION['payment'] != $include_modules[0]['class']))) {
  2. $_SESSION['payment'] = $include_modules[0]['class'];
  3. }
  4. if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
    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. if (str_contains($module, '\\')) {
  6. $CLICSHOPPING_PM = Registry::get('Payment_' . str_replace('\\', '_', $module));
  7. if (isset($CLICSHOPPING_PM->form_action_url)) {
  8. /**
  1. $code = $vendor . '\\' . $app . '\\' . $module;
  2. }
  3. }
  4. if (isset($code) && (in_array($code . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules) || in_array($code, $this->modules))) {
    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. if (str_contains($code, '\\')) {
  6. $class = Apps::getModuleClass($code, 'Shipping');
  7. $include_modules[] = [
  8. 'class' => $code,
  1. include($this->_directoryIncludes . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
  2. }
  3. }
  4. // exclude $modules_boxe and search if the modules exist
  5. if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
    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. $result = array_search($group, $this->getReadModulesDefaultDirectories());
  7. if (!is_null($result)) {
  8. if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
  9. include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
  1. }
  2. }
  3. // exclude $modules_boxe and search if the modules exist
  4. if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
  5. $result = array_search($group, $this->getReadModulesDefaultDirectories());
    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 (!is_null($result)) {
  7. if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
  8. include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
  9. } elseif (is_file($this->getDefaultTemplateDirectory() . DIRECTORY_SEPARATOR . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
  1. $currentParent = $newParentId;
  2. $visitedCategories = [];
  3. // Traverse up the parent chain to check for circular reference
  4. while ($currentParent !== 0) {
  5. if (in_array($currentParent, $visitedCategories)) {
    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. return true; // Already visited, indicates circular reference
  7. }
  8. if ($currentParent === $categoryId) {
  9. return true; // Found the original category in the parent chain
  1. // Validate numeric fields
  2. if (isset($data['suppliers_country_id']) && !is_numeric($data['suppliers_country_id'])) {
  3. $errors[] = 'Country ID must be numeric';
  4. }
  5. if (isset($data['suppliers_status']) && !in_array($data['suppliers_status'], [0, 1])) {
    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. $errors[] = 'Supplier status must be 0 or 1';
  7. }
  8. if (isset($data['languages_id']) && !is_numeric($data['languages_id'])) {
  9. $errors[] = 'Language ID must be numeric';
  1. while ($file = $dir->read()) {
  2. if (!is_dir($backup_directory . $file)) {
  3. $ext = substr($file, strrpos($file, '.') + 1);
  4. if (in_array($ext, array('zip', 'sql', 'gz')) && !isset($contents[$ext])) {
    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. $contents[$ext] = $file;
  6. if ($ext != 'sql') { // zip and gz (binaries) are prioritized over sql (plain text)
  7. break;
  8. }
  1. }
  2. } else {
  3. $products_attributes_image = '';
  4. }
  5. $checked = \is_array($selected_attributes) && \in_array($value['id'], $selected_attributes) ? ' checked' : '';
    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. $chk_id = 'chk_' . $QproductsOptionsName->valueInt('products_options_id') . '_' . $value['id'];
  7. $products_options_content_display .= '<div class="col-md-12">';
  8. $products_options_content_display .= '<span class="ModuleProductsInfoOptionsPullDownMenu">';
  9. $products_options_content_display .= '<div class="custom-control custom-checkbox">';
  1. foreach ($dir_content as $key => $content) {
  2. $path = $root_dir . DIRECTORY_SEPARATOR . $content;
  3. if (is_file($path) && is_readable($path)) {
  4. // skip ignored files
  5. if (!\in_array($content, $ignore_files)) {
    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. if (preg_match($ignore_regex, $content) == 0) {
  7. $content_chunks = explode(".", $content);
  8. $ext = $content_chunks[\count($content_chunks) - 1];
  9. // only include files with desired extensions
  10. if (\in_array($ext, $allow_extensions)) {
  1. if (!\in_array($content, $ignore_files)) {
  2. if (preg_match($ignore_regex, $content) == 0) {
  3. $content_chunks = explode(".", $content);
  4. $ext = $content_chunks[\count($content_chunks) - 1];
  5. // only include files with desired extensions
  6. if (\in_array($ext, $allow_extensions)) {
    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
  7. // save file name with path
  8. $all_data[] = $path;
  9. }
  10. }
  11. }
  1. }
  2. }
  3. } // if content is a directory and readable, add path and name
  4. elseif (is_dir($path) && is_readable($path)) {
  5. // skip any ignored dirs
  6. if (!\in_array($content, $ignore_dirs)) {
    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
  7. // recursive callback to open new directory
  8. $all_data = get_files($path, $all_data);
  9. }
  10. }
  11. } // end foreach

Your project should not use deprecated PHP features 9

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

  1. $response = curl_exec($ch);
  2. $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  3. $error = curl_error($ch);
  4. $info = curl_getinfo($ch);
  5. curl_close($ch);
    curl_close() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  6. if ($error) {
  7. $this->logger->error('cURL connection error', ['error' => $error, 'url' => $healthUrl]);
  8. throw new McpConnectionException("Connection failed: {$error}");
  9. }
  1. $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  2. $error = curl_error($ch);
  3. $info = curl_getinfo($ch);
  4. curl_close($ch);
    curl_close() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  5. $this->stats['messages_sent']++;
  6. $this->stats['last_activity'] = time();
  1. if ($ext != 'webp') {
  2. if ($img = imagecreatefromstring(file_get_contents($big_image_resized_path))) {
  3. $image = str_replace($ext, 'webp', $image);
  4. $this->imageResample->save($this->template->getDirectoryPathTemplateShopImages() . $image, $ext);
  5. imagedestroy($img);
    imagedestroy() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  6. }
  7. if (file_exists($big_image_resized_path)) {
  8. unlink($big_image_resized_path);
  9. }
  1. $tmp = tempnam('.', 'gif');
  2. if (!$tmp)
  3. $this->Error('Unable to create a temporary file');
  4. if (!imagepng($im, $tmp))
  5. $this->Error('Error while saving to temporary file');
  6. imagedestroy($im);
    imagedestroy() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  7. $info = $this->_parsepng($tmp);
  8. unlink($tmp);
  9. return $info;
  10. }
  1. $result = curl_exec($curl);
  2. if (empty($result)) {
  3. $info = curl_getinfo($curl);
  4. curl_close($curl);
    curl_close() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  5. } else {
  6. $info = 'error';
  7. }
  8. return $info;
  1. $result = curl_exec($curl);
  2. if (empty($result)) {
  3. $info = curl_getinfo($curl);
  4. curl_close($curl);
    curl_close() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  5. } else {
  6. $info = 'error';
  7. }
  8. return $info;
  1. $result = curl_exec($curl);
  2. if (empty($result)) {
  3. $info = curl_getinfo($curl);
  4. curl_close($curl);
    curl_close() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  5. } else {
  6. $info = 'error';
  7. }
  8. return $info;
  1. $result = curl_exec($curl);
  2. if (empty($result)) {
  3. $info = curl_getinfo($curl);
  4. curl_close($curl);
    curl_close() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  5. } else {
  6. $info = 'error';
  7. }
  8. return $info;
  1. $result = curl_exec($curl);
  2. if (empty($result)) {
  3. $info = curl_getinfo($curl);
  4. curl_close($curl);
    curl_close() has been deprecated in PHP 8.5 and will be removed from PHP in the next major version.
    Last edited by ClicShopping
  5. } else {
  6. $info = 'error';
  7. }
  8. return $info;

Mutable DateTime should be avoided in favor of DateTimeImmutable 41

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

New rule! We've recently added this rule to Insight. Don't be surprised to see new suggestions even though the codebase didn't change.
  1. }
  2. // Distribute feedback into weekly buckets
  3. foreach ($feedbackItems as $item) {
  4. $createdAt = new DateTime($item['created_at']);
  5. $now = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $daysDiff = $now->diff($createdAt)->days;
  7. $weekIndex = floor($daysDiff / 7);
  8. if ($weekIndex < $weeks) {
  9. $weekKey = "week_" . ($weeks - $weekIndex);
  1. }
  2. $this->createdAt = new DateTime($row['created_at']);
  3. if ($row['completed_at']) {
  4. $this->completedAt = new DateTime($row['completed_at']);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. }
  6. if ($row['metrics']) {
  7. $this->metrics = json_decode($row['metrics'], true);
  8. }
  1. $alert->criticId = $criticId;
  2. $alert->alertType = $alertType;
  3. $alert->severity = $severity;
  4. $alert->message = $message;
  5. $alert->context = $context;
  6. $alert->createdAt = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $alert;
  8. }
  9. /**
  1. $reputation->consistencyScore = 0.75;
  2. $reputation->expertiseAccuracy = 0.75;
  3. $reputation->totalEvaluations = 0;
  4. $reputation->status = 'bootstrapping';
  5. $reputation->calculatedAt = new DateTime();
  6. $reputation->lastDecayAt = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $reputation;
  8. }
  9. /**
  1. $this->producerAgentId = $producerAgentId;
  2. $this->output = $output;
  3. $this->outputType = $outputType;
  4. $this->executionMetrics = $executionMetrics;
  5. $this->executionContext = $executionContext;
  6. $this->timestamp = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $this->status = $status;
  8. }
  9. public function getResultId(): string { return $this->resultId; }
  10. public function getActionId(): string { return $this->actionId; }
  1. $this->evaluations = $evaluations;
  2. $this->consensusScore = $consensusScore;
  3. $this->consensusReached = $consensusReached;
  4. $this->aggregatedFeedback = $aggregatedFeedback;
  5. $this->outliers = $outliers;
  6. $this->createdAt = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. public function getConsensusId(): string { return $this->consensusId; }
  9. public function getOutputId(): string { return $this->outputId; }
  10. public function getEvaluations(): array { return $this->evaluations; }
  1. $this->userId = $userId;
  2. $this->languageId = $languageId;
  3. $this->systemState = $systemState;
  4. $this->userPreferences = $userPreferences;
  5. $this->environmentalData = $environmentalData;
  6. $this->timestamp = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. public function getContextId(): string { return $this->contextId; }
  9. public function getUserId(): string { return $this->userId; }
  10. public function getLanguageId(): int { return $this->languageId; }
  1. $this->clarityScore = $scores['clarity'];
  2. $this->overallScore = $this->calculateOverallScore($scores);
  3. $this->feedback = $feedback;
  4. $this->strengths = $strengths;
  5. $this->improvements = $improvements;
  6. $this->evaluatedAt = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. private function calculateOverallScore(array $scores): float
  9. {
  10. // Weighted average: accuracy (35%), completeness (25%), efficiency (25%), clarity (15%)
  1. }
  2. public function acknowledge(): void
  3. {
  4. $this->acknowledged = true;
  5. $this->acknowledgedAt = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. public function getFeedbackId(): string { return $this->feedbackId; }
  8. public function getTargetActorId(): string { return $this->targetActorId; }
  9. public function getOutputId(): string { return $this->outputId; }
  1. $this->staticConsensus = $staticConsensus;
  2. $this->consensusDifference = $consensusDifference;
  3. $this->weightedScores = $weightedScores;
  4. $this->confidenceLevel = $confidenceLevel;
  5. $this->consensusQuality = $consensusQuality;
  6. $this->calculatedAt = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. public function getEvaluationId(): string
  9. {
  10. return $this->evaluationId;
  1. $this->normalizedWeights = $normalizedWeights;
  2. $this->explanations = $explanations;
  3. $this->overallRationale = $overallRationale;
  4. $this->factorAnalysis = $factorAnalysis;
  5. $this->bounds = $bounds;
  6. $this->calculatedAt = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $this->isFallback = $isFallback;
  8. $this->fallbackReason = $fallbackReason;
  9. }
  10. public function getEvaluationId(): string
  1. $this->predictedOutcome = $predictedOutcome;
  2. $this->confidenceEstimate = max(0.0, min(1.0, $confidenceEstimate));
  3. $this->identifiedRisks = $identifiedRisks;
  4. $this->successProbabilities = $successProbabilities;
  5. $this->recommendedMitigations = $recommendedMitigations;
  6. $this->predictedAt = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. public function getPredictionId(): string { return $this->predictionId; }
  9. public function getActionId(): string { return $this->actionId; }
  10. public function getPredictorAgentId(): string { return $this->predictorAgentId; }
  1. */
  2. private function logOperation(string $operation, array $data): void
  3. {
  4. $this->normalizationLog[] = [
  5. 'operation' => $operation,
  6. 'timestamp' => (new \DateTime())->format('Y-m-d H:i:s.u'),
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. 'data' => $data
  8. ];
  9. }
  10. }
  1. $stmt = $this->db->prepare($sql);
  2. $stmt->bindValue(':agent_id', $agentId);
  3. $stmt->bindValue(':output_type', $outputType);
  4. $stmt->bindValue(':capability_level', $level);
  5. $stmt->bindValue(':updated_at', (new DateTime())->format('Y-m-d H:i:s'));
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $stmt->execute();
  7. } else {
  8. // Create new capability
  9. $this->registerCapability($agentId, $outputType, $level);
  10. }
  1. $this->evaluatorAgentId = $evaluatorAgentId;
  2. $this->outputId = $outputId;
  3. $this->feedback = $feedback;
  4. $this->strengths = $strengths;
  5. $this->improvements = $improvements;
  6. $this->evaluatedAt = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. /**
  9. * Validates a score value
  10. *
  1. $this->finalScore = $finalScore;
  2. $this->agreementLevel = $agreementLevel;
  3. $this->outliers = $outliers;
  4. $this->discussionLog = $discussionLog;
  5. $this->createdAt = new DateTime();
  6. $this->resolvedAt = $consensusReached ? new DateTime() : null;
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. /**
  9. * Generates a unique session ID
  10. *
  1. *
  2. * @return int Elapsed time in seconds
  3. */
  4. public function getElapsedSeconds(): int
  5. {
  6. $now = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $now->getTimestamp() - $this->startedAt->getTimestamp();
  8. }
  9. /**
  10. * Gets the remaining time before timeout
  1. $days = 1;
  2. if ($startDate && $endDate) {
  3. $interval = $startDate->diff($endDate);
  4. $days = max(1, $interval->days);
  5. } elseif ($startDate) {
  6. $interval = $startDate->diff(new DateTime());
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $days = max(1, $interval->days);
  8. }
  9. // Get breakdown by evaluator
  10. $byEvaluator = $this->getEvaluationBreakdown('evaluator_agent_id', $whereClause, $params);
  1. updated_at = :updated_at
  2. WHERE expertise_level = :expertise_level";
  3. $stmt = $this->db->prepare($sql);
  4. $stmt->bindValue(':expertise_weight', (float)$weight);
  5. $stmt->bindValue(':updated_at', (new DateTime())->format('Y-m-d H:i:s'));
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $stmt->bindValue(':expertise_level', $level);
  7. $stmt->execute();
  8. if ($this->debug) {
  9. error_log(sprintf(
  1. *
  2. * @return int
  3. */
  4. public function getElapsedTime(): int
  5. {
  6. $now = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $now->getTimestamp() - $this->createdAt->getTimestamp();
  8. }
  9. /**
  10. * Get the remaining time until estimated completion in seconds
  1. $interval = $startDate->diff($endDate);
  2. return [
  3. 'report_id' => $this->generateUuid(),
  4. 'report_type' => $reportType,
  5. 'generated_at' => (new DateTime())->format('Y-m-d H:i:s'),
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. 'period' => [
  7. 'start_date' => $startDate->format('Y-m-d H:i:s'),
  8. 'end_date' => $endDate->format('Y-m-d H:i:s'),
  9. 'duration_days' => $interval->days,
  10. 'duration_hours' => ($interval->days * 24) + $interval->h
  1. // Generate alerts
  2. $alertCount = $this->generateAlerts($allIssues);
  3. return [
  4. 'detection_run_at' => (new DateTime())->format('Y-m-d H:i:s'),
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. 'period' => [
  6. 'start_date' => $startDate ? $startDate->format('Y-m-d H:i:s') : 'all time',
  7. 'end_date' => $endDate ? $endDate->format('Y-m-d H:i:s') : 'now'
  8. ],
  9. 'issues_detected' => [
  1. 'consistencyScore' => (float)$row['consistency_score'],
  2. 'expertiseAccuracy' => (float)$row['expertise_accuracy'],
  3. 'totalEvaluations' => (int)$row['total_evaluations'],
  4. 'status' => $row['status'],
  5. 'calculatedAt' => new \DateTime($row['calculated_at']),
  6. 'lastDecayAt' => new \DateTime($row['last_decay_at'])
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. ];
  8. }
  9. return $reputations;
  10. }
  1. 'criticScore' => (float)$row['critic_score'],
  2. 'consensusScore' => (float)$row['consensus_score'],
  3. 'withinThreshold' => (bool)$row['within_threshold'],
  4. 'alignmentDelta' => (float)$row['alignment_delta'],
  5. 'feedbackAccepted' => (bool)$row['feedback_accepted'],
  6. 'evaluatedAt' => new \DateTime($row['evaluated_at'])
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. ];
  8. }
  9. return $outcomes;
  10. }
  1. // Generate recommendations
  2. $recommendations = $this->generateRecommendations($correlation, $qualityTrends, $weightingImpact);
  3. $report = [
  4. 'period' => 'Last 30 days',
  5. 'generated_at' => (new DateTime())->format('Y-m-d H:i:s'),
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. 'total_consensus_operations' => count($monthlyConsensus),
  7. 'correlation_analysis' => $correlation,
  8. 'quality_trends' => $qualityTrends,
  9. 'weighting_impact' => $weightingImpact,
  10. 'recommendations' => $recommendations
  1. criticScore: (float)$job['critic_score'],
  2. consensusScore: (float)$job['consensus_score'],
  3. withinThreshold: abs($job['critic_score'] - $job['consensus_score']) < 0.1,
  4. alignmentDelta: (float)$job['alignment_delta'],
  5. feedbackAccepted: (bool)$job['feedback_accepted'],
  6. evaluatedAt: new \DateTime(),
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. metadata: json_decode($job['metadata'], true) ?? []
  8. );
  9. // Process reputation update
  10. $this->reputationTracker->trackEvaluation($outcome);
  1. $outcome->criticScore = (float)($data['criticScore'] ?? $data['critic_score'] ?? 0.0);
  2. $outcome->consensusScore = (float)($data['consensusScore'] ?? $data['consensus_score'] ?? 0.0);
  3. $outcome->withinThreshold = (bool)($data['withinThreshold'] ?? $data['within_threshold'] ?? false);
  4. $outcome->alignmentDelta = (float)($data['alignmentDelta'] ?? $data['alignment_delta'] ?? 0.0);
  5. $outcome->feedbackAccepted = (bool)($data['feedbackAccepted'] ?? $data['feedback_accepted'] ?? false);
  6. $outcome->evaluatedAt = new \DateTime($data['evaluatedAt'] ?? $data['evaluated_at'] ?? 'now');
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $outcome;
  8. }
  9. /**
  1. $this->evaluations = $evaluations;
  2. $this->reputations = $reputations;
  3. $this->agreementLevel = $agreementLevel;
  4. $this->confidence = $confidence;
  5. $this->stability = $stability;
  6. $this->calculatedAt = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. /**
  9. * Get consensus result as array for serialization
  10. *
  1. criticScore: (float)$data['critic_score'],
  2. consensusScore: (float)$data['consensus_score'],
  3. withinThreshold: (bool)$data['within_threshold'],
  4. alignmentDelta: (float)$data['alignment_delta'],
  5. feedbackAccepted: (bool)$data['feedback_accepted'],
  6. evaluatedAt: new \DateTime($data['evaluated_at']),
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. metadata: $data['metadata'] ?? []
  8. );
  9. }
  10. }
  1. $history->criticScore = $criticScore;
  2. $history->alignmentDelta = abs($consensusScore - $criticScore);
  3. $history->reputationImpact = $newReputation - $oldReputation;
  4. $history->oldReputation = $oldReputation;
  5. $history->newReputation = $newReputation;
  6. $history->recordedAt = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $history;
  8. }
  9. /**
  1. $alert->message = $row['message'];
  2. $alert->context = $row['context'] ? json_decode($row['context'], true) : null;
  3. $alert->acknowledged = (bool)$row['acknowledged'];
  4. $alert->acknowledgedBy = $row['acknowledged_by'];
  5. $alert->acknowledgedAt = $row['acknowledged_at'] ? new \DateTime($row['acknowledged_at']) : null;
  6. $alert->createdAt = new \DateTime($row['created_at']);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $alert;
  8. }
  9. /**
  1. $history->criticScore = (float)$row['critic_score'];
  2. $history->alignmentDelta = (float)$row['alignment_delta'];
  3. $history->reputationImpact = (float)$row['reputation_impact'];
  4. $history->oldReputation = (float)$row['old_reputation'];
  5. $history->newReputation = (float)$row['new_reputation'];
  6. $history->recordedAt = new \DateTime($row['recorded_at']);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $history;
  8. }
  9. /**
  1. $history->criticScore = $criticScore;
  2. $history->alignmentDelta = $alignmentDelta;
  3. $history->reputationImpact = $newReputation - $oldReputation;
  4. $history->oldReputation = $oldReputation;
  5. $history->newReputation = $newReputation;
  6. $history->recordedAt = new DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $this->store->saveHistory($history);
  8. }
  9. /**
  1. $this->version = $version;
  2. $this->senderId = $senderId;
  3. $this->recipientId = $recipientId;
  4. $this->payload = $payload;
  5. $this->correlationId = $correlationId;
  6. $this->timestamp = new \DateTime();
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $this->retryCount = 0;
  8. $this->metadata = [
  9. 'created_at' => $this->timestamp->format('Y-m-d H:i:s.u'),
  10. 'protocol_version' => $version
  11. ];
  1. try {
  2. $Q = $this->db->prepare('SELECT date_created FROM :table_products_cockpit_ai_rule_adjustments WHERE rule_key = :key ORDER BY date_created DESC LIMIT 1');
  3. $Q->bindValue(':key', $ruleKey);
  4. $Q->execute();
  5. if (!$Q->fetch()) return true;
  6. return (new \DateTime())->diff(new \DateTime($Q->value('date_created')))->days >= 7;
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. } catch (\Throwable) {
  8. return true;
  9. }
  10. }
  1. $factors['seo_score'] = new ScoreFactor(null, 100.0, notAnalyzed: true);
  2. }
  3. // REQ-SC-01 : Récupération de l'âge du produit et du max catalogue
  4. $dateAdded = new \DateTime($product['products_date_added'] ?? 'now');
  5. $ageDays = (int) $dateAdded->diff(new \DateTime())->format('%a');
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $maxDays = $context->catalog->ageMax ?? 365;
  7. // Ajout du facteur de fraîcheur
  8. $factors['creation_date'] = new CreationDateFactor($ageDays, $maxDays);
  1. * @return string
  2. */
  3. private function formatDate(string $dateString): string
  4. {
  5. try {
  6. $dt = new \DateTime($dateString);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $dt->format('d/m/Y H:i');
  8. } catch (\Throwable) {
  9. return $dateString;
  10. }
  11. }
  1. * @return string
  2. */
  3. private function formatDate(string $dateString): string
  4. {
  5. try {
  6. $dt = new \DateTime($dateString);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. return $dt->format('d/m/Y H:i');
  8. } catch (\Throwable) {
  9. return $dateString;
  10. }
  11. }
  1. if (!empty($_POST['schdate'])) {
  2. $schdate = HTML::sanitize($_POST['schdate']);
  3. $date1 = new \DateTime(date('Y-m-d'));
  4. $date2 = new \DateTime($schdate);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. if ($date1 < $date2) {
  6. $status = 0;
  7. }
  8. } else {
  1. if (!empty($_POST['schdate'])) {
  2. $schdate = HTML::sanitize($_POST['schdate']);
  3. $date1 = new \DateTime(date('Y-m-d'));
  4. $date2 = new \DateTime($schdate);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. if ($date1 < $date2) {
  6. $status = 0;
  7. }
  8. } else {
  1. </div>
  2. <?php
  3. if ((ACCOUNT_DOB == 'true' && ($CLICSHOPPING_Customer->getCustomersGroupID() == 0)) || (ACCOUNT_DOB_PRO == 'true' && ($CLICSHOPPING_Customer->getCustomersGroupID() != 0))) {
  4. if (!empty($customers_dob)) {
  5. $customers_dob = DateTime::toShort($customers_dob);
  6. $dateObj = new \DateTime($customers_dob);
    Use DateTimeImmutable instead of DateTime.
    Time to fix: about 30 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $customers_dob = $dateObj->format('Y-m-d');
  8. } else {
  9. $customers_dob = null;
  10. }
  11. ?>