Your project uses non-strict array lookups 4
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- // Note: For production, this should use ModeSelector's STOPWORDS constant
- // or be externalized to database (v2 improvement)
- $stopWords = ['the', 'a', 'an', 'and', 'or', 'but', 'in', 'on', 'at', 'to', 'for', 'new', 'official', 'original'];
- $words = explode(' ', $normalized);
- $words = array_filter($words, function($word) use ($stopWords) {
- return !in_array($word, $stopWords) && strlen($word) > 1;
- });
- return implode(' ', $words);
- }
- $productsProcessed = $this->processLanguage($currentLanguage);
- $processedCount += $productsProcessed;
- // Move to next language if current is complete
- if ($productsProcessed < $this->batchSize) {
- $currentLanguageIndex = array_search($currentLanguage, array_column($languages, 'languages_id'));
- if ($currentLanguageIndex !== false && isset($languages[$currentLanguageIndex + 1])) {
- $currentLanguage = $languages[$currentLanguageIndex + 1]['languages_id'];
- error_log("[ProcessSeoFaqBatch] Moving to next language: {$currentLanguage}");
- } else {
- }
- $method = strtoupper($_SERVER["REQUEST_METHOD"]);
- $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
- if (!in_array($method, $allowedMethods)) {
- throw new Exception("Invalid HTTP method: " . $method);
- }
- return $method;
- }
- $flags['session_id'] = false;
- }
- // Security: Validate method against whitelist
- $allowed_methods = ['post', 'get'];
- $safe_method = in_array(strtolower($method ?? 'post'), $allowed_methods) ? strtolower($method) : 'post';
- // Security: Sanitize form action URL
- $safe_action = static::sanitizeUrl($action);
- $form = '<form name="' . static::outputProtected($name) . '" action="' . $safe_action . '" method="' . $safe_method . '"';
Your project should not contain PHP files defining multiple classes 2
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.file_contains_more_than_one_class
gyakutsuki