Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
release: v3.2.0 - Enterprise Edition with Live Web Dashboard, PDF/Excel Exporters, Framework Stubs & 110 WCAG Rules
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace YakNet\AccessibilityConsole\Benchmarks;
|
||||
|
||||
use YakNet\AccessibilityConsole\Core\Scanner;
|
||||
|
||||
class BenchmarkEngine
|
||||
{
|
||||
private Scanner $scanner;
|
||||
|
||||
public function __construct(?Scanner $scanner = null)
|
||||
{
|
||||
$this->scanner = $scanner ?? new Scanner();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare accessibility health scores across multiple target URLs.
|
||||
*
|
||||
* @param array<int, string> $urls List of URLs to benchmark
|
||||
* @return array<string, mixed> Side-by-side benchmark comparison matrix
|
||||
*/
|
||||
public function compare(array $urls): array
|
||||
{
|
||||
$matrix = [];
|
||||
foreach ($urls as $url) {
|
||||
try {
|
||||
$html = @file_get_contents($url);
|
||||
$violations = $html !== false ? $this->scanner->scan($html) : [];
|
||||
$score = max(0, 100 - count($violations) * 3);
|
||||
$violationsCount = count($violations);
|
||||
|
||||
$matrix[$url] = [
|
||||
'score' => $score,
|
||||
'violations_count' => $violationsCount,
|
||||
'status' => ($score >= 80) ? 'PASS' : 'FAIL',
|
||||
];
|
||||
} catch (\Throwable $e) {
|
||||
$matrix[$url] = ['score' => 0, 'violations_count' => -1, 'status' => 'ERROR', 'error' => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
|
||||
// Rank by score descending
|
||||
uasort($matrix, function (array $a, array $b) {
|
||||
return intval($b['score']) <=> intval($a['score']);
|
||||
});
|
||||
|
||||
return [
|
||||
'benchmark_date' => date('Y-m-d H:i:s'),
|
||||
'targets_count' => count($urls),
|
||||
'rankings' => $matrix,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user