Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
33.33% covered (danger)
33.33%
4 / 12
CRAP
35.48% covered (danger)
35.48%
11 / 31
Svg
0.00% covered (danger)
0.00%
0 / 1
33.33% covered (danger)
33.33%
4 / 12
75.42
35.48% covered (danger)
35.48%
11 / 31
 __construct($height, $widht, $name = null)
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 setDimensions($height, $width)
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 __toString()
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setViewBox($x1, $y1, $x2, $y2)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 strokeColor($r=NULL, $g=0, $b=0)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 drawPoint($item, $parameters = NULL)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 drawLine($item, $parameters = NULL)
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
6 / 6
 drawSequence($item, $parameters = NULL)
0.00% covered (danger)
0.00%
0 / 1
20
0.00% covered (danger)
0.00%
0 / 11
 drawRect($item, $parameters = NULL)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 drawPol($item, $parameters = NULL)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 drawCircle($item, $parameters = NULL)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 drawElypse($item, $parameters = NULL)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
<?php
/**
 *
 */
namespace aae\svg {
    /**
     * @author Axel Ancona Esselmann
     * @package aae\svg
     */
    class Svg {
        protected $_canvas = null;
        public function __construct($height, $widht, $name = null) {
            $this->_canvas = new Canvas($height, $widht, $name);
        }
        public function setDimensions($height, $width) {
            $this->_canvas->setDimensions($width, $height);
        }
        public function __toString() {
            return (string)$this->_canvas;
        }
        public function setViewBox($x1, $y1, $x2, $y2) {
            $this->_canvas->setViewBox($x1, $y1, $x2, $y2);
        }
        public function strokeColor($r=NULL, $g=0, $b=0) {
            $this->_canvas->strokeColor($r, $g, $b);
        }
        public function drawPoint($item, $parameters = NULL) {
        }
        public function drawLine($item, $parameters = NULL) {
            $a = $item->getA();
            $b = $item->getB();
            $svgLine = new Line($a->x, $a->y, $b->x, $b->y);
            $svgLine->strokeColor($this->_canvas->getStrokeColor());
            $this->_canvas->add($svgLine, $parameters);
        }
        public function drawSequence($item, $parameters = NULL) {
            $path = new \aae\svg\Path();
            $path->strokeColor($this->_canvas->getStrokeColor());
            if (method_exists($item, "getId") && !is_null($id = $item->getId())) {
                echo "has id: $id<br />";
                $path->setId($id);
            }
            foreach ($item as $point) {
                $path->addPoint($point->x, $point->y);
            }
            $this->_canvas->add($path, $parameters);
        }
        public function drawRect($item, $parameters = NULL) {
        }
        public function drawPol($item, $parameters = NULL) {
        }
        public function drawCircle($item, $parameters = NULL) {
        }
        public function drawElypse($item, $parameters = NULL) {
        }
    }
}