Compare commits

...
3 Commits
Author SHA1 Message Date
Enes Yakıştır 84c6521195 fix: update Gemini model to gemini-3.1-flash-lite in GeminiFixer
bump version to 2.9.2
2026-06-07 10:49:30 +03:00
Enes Yakıştır 0134482c54 fix: resolve string/int type mismatches in HtmlDashboardReporter
- preg_replace() return value guarded with '?? ''' to eliminate string|null type
- location line number explicitly cast to (string) before concatenation
- PHPStan level 9 confirms zero errors after fix
2026-06-07 10:20:55 +03:00
Enes Yakıştır c9ffbdba08 feat: extend scan level range 1-9 and confirm PHPStan level 9 zero errors 2026-06-07 10:18:15 +03:00
4 changed files with 7 additions and 6 deletions
+1
View File
@@ -12,6 +12,7 @@
"yaknet" "yaknet"
], ],
"homepage": "https://forum.yak.net.tr", "homepage": "https://forum.yak.net.tr",
"version": "2.9.2",
"type": "library", "type": "library",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
+1 -1
View File
@@ -45,7 +45,7 @@ FIX: [Only the corrected HTML snippet]
PROMPT; PROMPT;
try { try {
$result = $this->client->generativeModel('gemini-2.5-flash')->generateContent($prompt); $result = $this->client->generativeModel('gemini-3.1-flash-lite')->generateContent($prompt);
return trim($result->text()); return trim($result->text());
} catch (\Throwable $e) { } catch (\Throwable $e) {
return "AI Düzeltme Hatası: " . $e->getMessage(); return "AI Düzeltme Hatası: " . $e->getMessage();
+3 -3
View File
@@ -31,7 +31,7 @@ class ScanCommand extends Command
->addOption('crawl', null, InputOption::VALUE_NONE, 'Crawl internal links recursively') ->addOption('crawl', null, InputOption::VALUE_NONE, 'Crawl internal links recursively')
->addOption('depth', null, InputOption::VALUE_REQUIRED, 'Maximum crawling depth', '3') ->addOption('depth', null, InputOption::VALUE_REQUIRED, 'Maximum crawling depth', '3')
->addOption('max-pages', null, InputOption::VALUE_REQUIRED, 'Maximum number of pages to crawl', '20') ->addOption('max-pages', null, InputOption::VALUE_REQUIRED, 'Maximum number of pages to crawl', '20')
->addOption('level', 'l', InputOption::VALUE_REQUIRED, 'Accessibility scan level (1-5)', '4'); ->addOption('level', 'l', InputOption::VALUE_REQUIRED, 'Accessibility scan level (1-9)', '4');
} }
protected function execute(InputInterface $input, OutputInterface $output): int protected function execute(InputInterface $input, OutputInterface $output): int
@@ -51,8 +51,8 @@ class ScanCommand extends Command
$levelOption = $input->getOption('level'); $levelOption = $input->getOption('level');
$level = is_numeric($levelOption) ? (int)$levelOption : 4; $level = is_numeric($levelOption) ? (int)$levelOption : 4;
if ($level < 1 || $level > 5) { if ($level < 1 || $level > 9) {
$io->error("Scan level must be between 1 and 5."); $io->error("Scan level must be between 1 and 9.");
return Command::FAILURE; return Command::FAILURE;
} }
+2 -2
View File
@@ -96,7 +96,7 @@ class HtmlDashboardReporter
preg_match('/EXPLANATION:(.*)FIX:(.*)/s', $aiSuggestion, $matches); preg_match('/EXPLANATION:(.*)FIX:(.*)/s', $aiSuggestion, $matches);
$explanation = trim($matches[1] ?? ''); $explanation = trim($matches[1] ?? '');
$fixedCode = trim($matches[2] ?? ''); $fixedCode = trim($matches[2] ?? '');
$fixedCode = preg_replace('/^```html\s*|\s*```$/i', '', $fixedCode); $fixedCode = preg_replace('/^```html\s*|\s*```$/i', '', $fixedCode) ?? '';
} else { } else {
$fixedCode = $aiSuggestion; $fixedCode = $aiSuggestion;
} }
@@ -104,7 +104,7 @@ class HtmlDashboardReporter
$escapedSnippet = htmlspecialchars($v->htmlSnippet, ENT_QUOTES, 'UTF-8'); $escapedSnippet = htmlspecialchars($v->htmlSnippet, ENT_QUOTES, 'UTF-8');
$escapedFixed = $fixedCode ? htmlspecialchars($fixedCode, ENT_QUOTES, 'UTF-8') : ''; $escapedFixed = $fixedCode ? htmlspecialchars($fixedCode, ENT_QUOTES, 'UTF-8') : '';
$escapedExplanation = $explanation ? htmlspecialchars($explanation, ENT_QUOTES, 'UTF-8') : ''; $escapedExplanation = $explanation ? htmlspecialchars($explanation, ENT_QUOTES, 'UTF-8') : '';
$locationStr = $v->location ? htmlspecialchars($v->location['file'] . ':' . $v->location['line'], ENT_QUOTES, 'UTF-8') : 'N/A'; $locationStr = $v->location ? htmlspecialchars($v->location['file'] . ':' . (string)$v->location['line'], ENT_QUOTES, 'UTF-8') : 'N/A';
$escapedRuleId = htmlspecialchars($v->ruleId, ENT_QUOTES, 'UTF-8'); $escapedRuleId = htmlspecialchars($v->ruleId, ENT_QUOTES, 'UTF-8');
$escapedMessage = htmlspecialchars($v->message, ENT_QUOTES, 'UTF-8'); $escapedMessage = htmlspecialchars($v->message, ENT_QUOTES, 'UTF-8');