- Add comprehensive health check system with multiple endpoints - Add Prometheus metrics endpoint - Add production logging configurations (5 strategies) - Add complete deployment documentation suite: * QUICKSTART.md - 30-minute deployment guide * DEPLOYMENT_CHECKLIST.md - Printable verification checklist * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference * production-logging.md - Logging configuration guide * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation * README.md - Navigation hub * DEPLOYMENT_SUMMARY.md - Executive summary - Add deployment scripts and automation - Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment - Update README with production-ready features All production infrastructure is now complete and ready for deployment.
78 lines
2.2 KiB
PHP
78 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Svg\Builder;
|
|
|
|
use App\Framework\Core\ValueObjects\Dimensions;
|
|
use App\Framework\Filesystem\FileStorage;
|
|
use App\Framework\Svg\ValueObjects\Geometry\ViewBox;
|
|
|
|
/**
|
|
* Static factory for creating SVG canvases
|
|
* Entry point for SVG generation
|
|
*/
|
|
final class SvgBuilder
|
|
{
|
|
/**
|
|
* Create canvas with dimensions
|
|
*/
|
|
public static function canvas(
|
|
Dimensions $dimensions,
|
|
?ViewBox $viewBox = null,
|
|
?FileStorage $fileStorage = null
|
|
): SvgCanvas {
|
|
return new SvgCanvas($dimensions, $viewBox, null, null, $fileStorage);
|
|
}
|
|
|
|
/**
|
|
* Create canvas from width and height
|
|
*/
|
|
public static function create(int $width, int $height, ?FileStorage $fileStorage = null): SvgCanvas
|
|
{
|
|
return new SvgCanvas(new Dimensions($width, $height), null, null, null, $fileStorage);
|
|
}
|
|
|
|
/**
|
|
* Create square canvas
|
|
*/
|
|
public static function square(int $size, ?FileStorage $fileStorage = null): SvgCanvas
|
|
{
|
|
return new SvgCanvas(new Dimensions($size, $size), null, null, null, $fileStorage);
|
|
}
|
|
|
|
/**
|
|
* Create canvas with responsive viewBox
|
|
*/
|
|
public static function responsive(int $width, int $height, ?FileStorage $fileStorage = null): SvgCanvas
|
|
{
|
|
$dimensions = new Dimensions($width, $height);
|
|
$viewBox = ViewBox::fromDimensions($dimensions);
|
|
|
|
return new SvgCanvas($dimensions, $viewBox, null, null, $fileStorage);
|
|
}
|
|
|
|
/**
|
|
* Common canvas sizes
|
|
*/
|
|
public static function icon(int $size = 24, ?FileStorage $fileStorage = null): SvgCanvas
|
|
{
|
|
return self::square($size, $fileStorage);
|
|
}
|
|
|
|
public static function badge(int $width = 100, int $height = 20, ?FileStorage $fileStorage = null): SvgCanvas
|
|
{
|
|
return self::create($width, $height, $fileStorage);
|
|
}
|
|
|
|
public static function card(int $width = 400, int $height = 300, ?FileStorage $fileStorage = null): SvgCanvas
|
|
{
|
|
return self::create($width, $height, $fileStorage);
|
|
}
|
|
|
|
public static function chart(int $width = 600, int $height = 400, ?FileStorage $fileStorage = null): SvgCanvas
|
|
{
|
|
return self::responsive($width, $height, $fileStorage);
|
|
}
|
|
}
|