commit e34802557966ffd4ade1775d4e849a1b23b133e7
Author: Enes Yakıştır
Date: Wed May 13 09:10:43 2026 +0300
Major upgrade v2.0.0
diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..f0d664a
--- /dev/null
+++ b/.env.example
@@ -0,0 +1 @@
+GEMINI_API_KEY=your_api_key_here
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9805767
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/vendor/
+/.env
+/composer.lock
+/rapor.html
+/.phpunit.result.cache
+/phpstan-baseline.neon
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..288f9dd
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 YakNet Bilişim
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..22ecfdb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,96 @@
+# YakNet Accessibility Console 2.0 (AI-Powered)
+
+[](https://php.net)
+[](LICENSE)
+[](https://gemini.google.com)
+
+**YakNet Accessibility Console**, web projelerinizdeki erişilebilirlik (WCAG 2.1) hatalarını sadece tespit etmekle kalmayan, aynı zamanda **Yapay Zeka (AI)** desteğiyle bu hataları otomatik olarak düzeltebilen (Self-Healing) profesyonel bir PHP kütüphanesidir.
+
+## 🌟 Öne Çıkan Özellikler
+
+- **🤖 AI Self-Healing:** Tespit edilen WCAG hataları için Google Gemini AI üzerinden akıllı çözüm önerileri alır ve isterseniz kaynak kodunuzu (Blade, Twig, PHP) otomatik olarak tamir eder.
+- **⚡ Modern CLI:** Rust/Vite tarzı şık bir komut satırı arayüzü ile saniyeler içinde tarama ve düzeltme yapın.
+- **📊 Görsel Dashboard:** Tarama sonuçlarını modern ve şık bir HTML raporu olarak dışarı aktarın.
+- **🔍 Akıllı Kaynak Tespiti:** Hataları projenizdeki tam dosya yolu ve satır numarası ile eşleştirir.
+- **🛠️ Geliştirici Dostu:** PSR-4 uyumlu, modern PHP 8.2+ mimarisi ve genişletilebilir kural motoru.
+
+## 📦 Kurulum
+
+Composer ile projenize hemen dahil edin:
+
+```bash
+composer require yaknet/accessibility-console
+```
+
+## 🚀 CLI Kullanımı
+
+Kütüphane, `vendor/bin/a11y` (veya kütüphane dizininde `bin/a11y`) üzerinden kullanılabilir.
+
+### 1. Standart Tarama
+Bir URL'yi veya yerel bir HTML dosyasını tarayın:
+```bash
+bin/a11y scan https://test-siteniz.com
+```
+
+### 2. AI Destekli Tarama ve Raporlama
+Yapay zeka önerileriyle birlikte tarama yapın ve sonucu HTML olarak kaydedin:
+```bash
+bin/a11y scan https://test-siteniz.com --ai --report=sonuc.html
+```
+
+### 3. Otomatik Düzeltme (Self-Healing) - **DEVRİMSEL**
+Tespit edilen hataları yapay zekaya düzelttirin ve dosyalarınızı güncelleyin:
+```bash
+bin/a11y fix https://test-siteniz.com --project-path=/var/www/projeniz
+```
+
+## 💻 Kütüphane Olarak Kullanım
+
+Kendi PHP uygulamalarınızın içine entegre edin:
+
+```php
+use YakNet\AccessibilityConsole\Core\Scanner;
+use YakNet\AccessibilityConsole\Rules\StandardRuleSet;
+
+// 1. Scanner'ı ve Kuralları Hazırla
+$scanner = new Scanner();
+foreach (StandardRuleSet::all() as $rule) {
+ $scanner->addRule($rule);
+}
+
+// 2. HTML İçeriğini Tara
+$html = file_get_contents('view.html');
+$violations = $scanner->scan($html);
+
+// 3. Sonuçları İşle
+foreach ($violations as $v) {
+ echo "Hata: {$v->message} (Kural: {$v->ruleId})\n";
+}
+```
+
+## ⚙️ Yapılandırma
+
+AI özelliklerini kullanabilmek için projenizin kök dizininde bir `.env` dosyası oluşturun ve **Google Gemini API** anahtarınızı ekleyin:
+
+```env
+GEMINI_API_KEY=AIzaSyA...your_key_here
+```
+
+## 🛠️ Mevcut Kurallar (WCAG 2.1)
+
+- **A11Y_VIEWPORT:** Zoom engelleme kontrolü.
+- **WCAG_1_1_1_ALT:** Görsel alt metin kontrolü.
+- **WCAG_1_3_1_LABEL:** Form etiketi kontrolü.
+- **WCAG_1_3_1_FIELDSET:** Fieldset/Legend kontrolü.
+- **WCAG_1_3_1_HEADING:** Başlık hiyerarşisi kontrolü.
+- **WCAG_2_4_4_LINK_TEXT:** Boş link kontrolü.
+- **WCAG_3_1_1_LANG:** HTML dil etiketi kontrolü.
+- **WCAG_4_1_2_BUTTON:** Boş buton kontrolü.
+
+## 🤝 Katkıda Bulunma
+
+Bu proje açık kaynaklıdır ve katkılarınıza açıktır. Lütfen hata bildirimleri için `Issue` açmaktan veya yeni özellikler için `Pull Request` göndermekten çekinmeyin.
+
+## 📜 Lisans
+
+Bu yazılım **YakNet Bilişim** tarafından geliştirilmiştir ve **MIT Lisansı** altında lisanslanmıştır. Detaylar için [LICENSE](LICENSE) dosyasına göz atabilirsiniz.
\ No newline at end of file
diff --git a/bin/a11y b/bin/a11y
new file mode 100644
index 0000000..c447cb0
--- /dev/null
+++ b/bin/a11y
@@ -0,0 +1,16 @@
+#!/usr/bin/env php
+add(new ScanCommand());
+$application->add(new FixCommand());
+
+$application->run();
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..0db6a3e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,49 @@
+{
+ "name": "yaknet/accessibility-console",
+ "description": "A professional AI-powered WCAG 2.1 accessibility scanner with self-healing capabilities.",
+ "keywords": [
+ "accessibility",
+ "wcag",
+ "a11y",
+ "scanner",
+ "ai",
+ "gemini",
+ "self-healing",
+ "yaknet"
+ ],
+ "homepage": "https://forum.yak.net.tr",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "YakNet Bilişim",
+ "email": "dev@yak.net.tr",
+ "role": "Developer"
+ }
+ ],
+ "require": {
+ "php": "^8.2",
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "symfony/console": "^6.4|^7.0",
+ "symfony/yaml": "^6.4|^7.0",
+ "monolog/monolog": "^3.0",
+ "vlucas/phpdotenv": "^5.6",
+ "google-gemini-php/client": "^1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.5",
+ "phpstan/phpstan": "^1.10"
+ },
+ "autoload": {
+ "psr-4": {
+ "YakNet\\AccessibilityConsole\\": "src/"
+ }
+ },
+ "bin": [
+ "bin/a11y"
+ ],
+ "minimum-stability": "stable",
+ "prefer-stable": true
+}
\ No newline at end of file
diff --git a/demo/broken.html b/demo/broken.html
new file mode 100644
index 0000000..d39825b
--- /dev/null
+++ b/demo/broken.html
@@ -0,0 +1,20 @@
+
+
+
+ Broken Page
+
+
+
+ Fix: Add an alt="" attribute
+ describing the image, or alt="" if decorative.
+
+
+
+
+ home.php:14
+
+
+
+
+
2
+
+
Image
+ is missing alt attribute.
+
Rule:
+ img-alt-text
+
+ <img src="images/widget.png" width="100">
+
+
+ Fix: Add an alt="" attribute
+ describing the image, or alt="" if decorative.
+
+
+
+
+ home.php:14
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/fixed_preview.html b/demo/fixed_preview.html
new file mode 100644
index 0000000..9c4c3bc
--- /dev/null
+++ b/demo/fixed_preview.html
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+ YakNet Dynamic Demo (Fixed)
+
+
+
+
+
+
+
My Dynamic Site (Accessible)
+
+
+
+
+
+
Latest Products
+
Welcome to our accessible product catalog.
+
+
+
+
+
+
+
Super Gadget
+
$99
+
+
+
+
+
+
Mega Widget
+
$49
+
+
+
+
+
+
Ultra Thing
+
$199
+
+
+
+
+
+
+
Sponsors
+
+
+
+
+
+
+
+
+
+ ✅ Accessibility: 0 Errors
+
+
+
\ No newline at end of file
diff --git a/demo/fixed_preview_with_widget.html b/demo/fixed_preview_with_widget.html
new file mode 100644
index 0000000..7984a99
--- /dev/null
+++ b/demo/fixed_preview_with_widget.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ YakNet Dynamic Demo (Fixed)
+
+
+
+
+
+
My Dynamic Site (Accessible)
+
Success widget demonstration.
+
+
+
+ ✅ Accessibility: 0 Errors
+
+
+
+
\ No newline at end of file
diff --git a/demo/index.php b/demo/index.php
new file mode 100644
index 0000000..51eace3
--- /dev/null
+++ b/demo/index.php
@@ -0,0 +1,70 @@
+addRule(new ImgAltText());
+$scanner->addRule(new FormLabel());
+$scanner->addRule(new \YakNet\AccessibilityConsole\Rules\HtmlHasLang());
+$scanner->addRule(new \YakNet\AccessibilityConsole\Rules\EmptyLink());
+
+// Scan the captured HTML
+$violations = $scanner->scan($html);
+
+if (!empty($violations)) {
+ // Locate Sources
+ // We point it to the 'views' directory so it knows where to look for the error source
+ $locator = new SourceLocator(__DIR__ . '/views');
+
+ foreach ($violations as $violation) {
+ $location = $locator->locate($violation->snippet);
+ if ($location) {
+ $violation->setSourceLocation($location['file'], $location['line']);
+ }
+ }
+
+ // Render Report
+ $reporter = new HtmlReporter();
+ $reportHtml = $reporter->render($violations);
+
+ // Inject into body
+ $html = str_replace('
+
Accessibility Console Preview
+
This is a static preview of how the error console looks.
+
Click the "Accessibility: 2 Errors" button in the bottom right.