Compare commits

...
4 Commits
4 changed files with 30 additions and 17 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ use YakNet\AccessibilityConsole\Console\Command\InitCommand;
use YakNet\AccessibilityConsole\Console\Command\RulesCommand; use YakNet\AccessibilityConsole\Console\Command\RulesCommand;
$container = ContainerFactory::create(); $container = ContainerFactory::create();
$application = new Application('YakNet Accessibility Console', '3.2.0'); $application = new Application('YakNet Accessibility Console', '3.2.2');
// Add commands resolved via DI Container // Add commands resolved via DI Container
$application->addCommand($container->get(ScanCommand::class)); $application->addCommand($container->get(ScanCommand::class));
+13 -11
View File
@@ -12,7 +12,7 @@
"yaknet" "yaknet"
], ],
"homepage": "https://forum.yak.net.tr", "homepage": "https://forum.yak.net.tr",
"version": "3.2.0", "version": "3.2.4",
"type": "library", "type": "library",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
@@ -27,23 +27,25 @@
"ext-dom": "*", "ext-dom": "*",
"ext-libxml": "*", "ext-libxml": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"symfony/console": "^6.4|^7.0|^8.0", "symfony/console": "^6.4 || ^7.0 || ^8.0",
"symfony/yaml": "^6.4|^7.0|^8.0", "symfony/yaml": "^6.4 || ^7.0 || ^8.0",
"monolog/monolog": "^3.0", "monolog/monolog": "^3.0",
"vlucas/phpdotenv": "^5.6", "vlucas/phpdotenv": "^5.6",
"google-gemini-php/client": "^1.0|^2.0", "google-gemini-php/client": "^1.0 || ^2.0",
"guzzlehttp/guzzle": "^7.8", "guzzlehttp/guzzle": "^7.8",
"masterminds/html5": "^2.8", "masterminds/html5": "^2.8",
"sabberworm/php-css-parser": "^9.4", "sabberworm/php-css-parser": "^8.4 || ^9.0",
"chrome-php/chrome": "^1.15", "chrome-php/chrome": "^1.15",
"sebastian/diff": "^5.1 || ^6.0 || ^7.0 || ^8.0 || ^9.0", "sebastian/diff": "^5.1 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"php-di/php-di": "^7.1", "php-di/php-di": "^7.1",
"symfony/css-selector": "^8.1", "symfony/css-selector": "^6.4 || ^7.0 || ^8.0",
"symfony/dom-crawler": "^8.1", "symfony/dom-crawler": "^6.4 || ^7.0 || ^8.0",
"spatie/color": "^1.5", "spatie/color": "^1.5 || ^2.0",
"intervention/image": "^3.0", "intervention/image": "^2.7 || ^3.0"
"dompdf/dompdf": "^3.0", },
"phpoffice/phpspreadsheet": "^2.0 || ^3.0" "suggest": {
"dompdf/dompdf": "Required for generating PDF Accessibility Certificates (^2.0 || ^3.0).",
"phpoffice/phpspreadsheet": "Required for exporting Excel Accessibility Audit Reports (^1.28 || ^2.0 || ^3.0)."
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^10.5", "phpunit/phpunit": "^10.5",
+4
View File
@@ -18,6 +18,10 @@ class ExcelReportExporter
*/ */
public static function exportExcel(array $scanResult, string $targetUrl): string public static function exportExcel(array $scanResult, string $targetUrl): string
{ {
if (!class_exists(Spreadsheet::class)) {
throw new \RuntimeException('To export Excel audit reports, please install phpspreadsheet via: composer require phpoffice/phpspreadsheet');
}
/** @var int $score */ /** @var int $score */
$score = is_numeric($scanResult['score'] ?? null) ? intval($scanResult['score']) : 0; $score = is_numeric($scanResult['score'] ?? null) ? intval($scanResult['score']) : 0;
+12 -5
View File
@@ -16,6 +16,12 @@ class PdfReportGenerator
*/ */
public static function generatePdf(array $scanResult, string $targetUrl): string public static function generatePdf(array $scanResult, string $targetUrl): string
{ {
if (!class_exists(Dompdf::class)) {
throw new \RuntimeException('To generate PDF certificates, please install dompdf via: composer require dompdf/dompdf');
}
date_default_timezone_set('Europe/Istanbul');
/** @var int $score */ /** @var int $score */
$score = is_numeric($scanResult['score'] ?? null) ? intval($scanResult['score']) : 0; $score = is_numeric($scanResult['score'] ?? null) ? intval($scanResult['score']) : 0;
@@ -54,14 +60,15 @@ class PdfReportGenerator
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset='utf-8'> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>WCAG 2.1 Erişilebilirlik Sertifikası ve Raporu</title> <title>WCAG 2.1 Erişilebilirlik Sertifikası ve Raporu</title>
<style> <style>
body { font-family: sans-serif; color: #1e293b; line-height: 1.5; font-size: 12px; margin: 0; padding: 20px; } * { font-family: 'DejaVu Sans', sans-serif; }
body { font-family: 'DejaVu Sans', sans-serif; color: #1e293b; line-height: 1.5; font-size: 11px; margin: 0; padding: 20px; }
.header { text-align: center; border-bottom: 2px solid #38bdf8; padding-bottom: 15px; margin-bottom: 20px; } .header { text-align: center; border-bottom: 2px solid #38bdf8; padding-bottom: 15px; margin-bottom: 20px; }
.title { font-size: 20px; font-weight: bold; color: #0f172a; } .title { font-size: 18px; font-weight: bold; color: #0f172a; }
.subtitle { font-size: 13px; color: #64748b; margin-top: 4px; } .subtitle { font-size: 12px; color: #64748b; margin-top: 4px; }
.badge { display: inline-block; padding: 6px 16px; border-radius: 12px; color: #fff; font-weight: bold; font-size: 14px; background: {$scoreColor}; } .badge { display: inline-block; padding: 6px 16px; border-radius: 12px; color: #fff; font-weight: bold; font-size: 13px; background: {$scoreColor}; }
.grid { margin-bottom: 20px; } .grid { margin-bottom: 20px; }
.card { background: #f8fafc; border: 1px solid #e2e8f0; padding: 12px; border-radius: 6px; margin-bottom: 10px; } .card { background: #f8fafc; border: 1px solid #e2e8f0; padding: 12px; border-radius: 6px; margin-bottom: 10px; }
.footer { text-align: center; border-top: 1px solid #e2e8f0; padding-top: 15px; font-size: 10px; color: #94a3b8; margin-top: 30px; } .footer { text-align: center; border-top: 1px solid #e2e8f0; padding-top: 15px; font-size: 10px; color: #94a3b8; margin-top: 30px; }