| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | } | 
| 26 | 26 | |
| 27 | 27 | /** | 
| 28 | - * @param Stop|Stop[] $stops | |
| 28 | + * @param Stop $stops | |
| 29 | 29 | */ | 
| 30 | 30 | public function appendStop(Stop $stops) | 
| 31 | 31 |      { | 
| @@ -43,6 +43,9 @@ discard block | ||
| 43 | 43 | $this->add(); | 
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | + /** | |
| 47 | + * @param string $name | |
| 48 | + */ | |
| 46 | 49 | public function createElement($name, $value = null, $attributes = []) | 
| 47 | 50 |      { | 
| 48 | 51 | return $this->root->createElement($name, $value, $attributes); | 
| @@ -99,6 +102,9 @@ discard block | ||
| 99 | 102 | $this->element->setAttribute($name, $value); | 
| 100 | 103 | } | 
| 101 | 104 | |
| 105 | + /** | |
| 106 | + * @param string $name | |
| 107 | + */ | |
| 102 | 108 | public function getXLinkAttribute($name) | 
| 103 | 109 |      { | 
| 104 | 110 |          return $this->element->getAttributeNS('xlink', $name); | 
| @@ -128,6 +134,9 @@ discard block | ||
| 128 | 134 | return $this; | 
| 129 | 135 | } | 
| 130 | 136 | |
| 137 | + /** | |
| 138 | + * @param string $name | |
| 139 | + */ | |
| 131 | 140 | protected function setAttribute($name, $value, $xLink = false) | 
| 132 | 141 |      { | 
| 133 | 142 |          if ($xLink === true) { | 
| @@ -42,6 +42,7 @@ | ||
| 42 | 42 | |
| 43 | 43 | /** | 
| 44 | 44 | * @inheritdoc | 
| 45 | + * @param string $id | |
| 45 | 46 | */ | 
| 46 | 47 | public function getChildById($id) | 
| 47 | 48 |      { | 
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | trait ElementTrait | 
| 14 | 14 |  { | 
| 15 | 15 | /** | 
| 16 | - * @param ElementInterface|ElementInterface[] $elements | |
| 16 | + * @param ElementInterface $elements | |
| 17 | 17 | * | 
| 18 | 18 | * @return $this | 
| 19 | 19 | */ | 
| @@ -20,7 +20,7 @@ | ||
| 20 | 20 | public function append(ElementInterface $elements) | 
| 21 | 21 |      { | 
| 22 | 22 | /** @var ElementInterface[] $elements */ | 
| 23 | -        $elements = array_filter(func_get_args(), function ($item) { | |
| 23 | +        $elements = array_filter(func_get_args(), function($item) { | |
| 24 | 24 | return $item instanceof ElementInterface; | 
| 25 | 25 | }); | 
| 26 | 26 | |
| @@ -20,6 +20,10 @@ | ||
| 20 | 20 | return $tag . (++$count); | 
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | + /** | |
| 24 | + * @param string $prefix | |
| 25 | + * @param integer $length | |
| 26 | + */ | |
| 23 | 27 | public static function random($prefix, $length) | 
| 24 | 28 |      { | 
| 25 | 29 | $length = intval($length); | 
| @@ -31,7 +31,7 @@ | ||
| 31 | 31 | } | 
| 32 | 32 | } | 
| 33 | 33 | $step = 1 / (count($colors) - 1); | 
| 34 | -        $offsets = array_map(function ($item) { | |
| 34 | +        $offsets = array_map(function($item) { | |
| 35 | 35 |              return $item % 1 !== 0 ? sprintf('%0.2f', $item) : $item; | 
| 36 | 36 | }, range(0, 1, $step)); | 
| 37 | 37 | |
| @@ -126,7 +126,7 @@ | ||
| 126 | 126 | return $p0; | 
| 127 | 127 | } | 
| 128 | 128 | $omt = 1 - $t; | 
| 129 | - $value = $p0 * $omt * $omt *$omt + | |
| 129 | + $value = $p0 * $omt * $omt * $omt + | |
| 130 | 130 | 3 * $p1 * $t * $omt * $omt + | 
| 131 | 131 | 3 * $p2 * $t * $t * $omt + | 
| 132 | 132 | $p3 * $t * $t * $t; | 
| @@ -4,10 +4,14 @@ discard block | ||
| 4 | 4 | |
| 5 | 5 | interface XMLDocumentInterface | 
| 6 | 6 |  { | 
| 7 | + /** | |
| 8 | + * @return \DOMElement | |
| 9 | + */ | |
| 7 | 10 | public function getElement(); | 
| 8 | 11 | |
| 9 | 12 | /** | 
| 10 | 13 | * @param mixed $value The text value of node. | 
| 14 | + * @return void | |
| 11 | 15 | */ | 
| 12 | 16 | public function setNodeValue($value); | 
| 13 | 17 | |
| @@ -32,9 +36,9 @@ discard block | ||
| 32 | 36 | public function getAttribute($name); | 
| 33 | 37 | |
| 34 | 38 | /** | 
| 35 | - * @param $namespaceURI | |
| 36 | - * @param $qualifiedName | |
| 37 | - * @param $value | |
| 39 | + * @param string $namespaceURI | |
| 40 | + * @param string $qualifiedName | |
| 41 | + * @param string $value | |
| 38 | 42 | * @return string | 
| 39 | 43 | */ | 
| 40 | 44 | public function setAttributeNS($namespaceURI, $qualifiedName, $value); | 
| @@ -64,14 +68,14 @@ discard block | ||
| 64 | 68 | * @param string $namespaceURI | 
| 65 | 69 | * @param string $qualifiedName | 
| 66 | 70 | * @param string $value | 
| 67 | - * @return mixed | |
| 71 | + * @return \DOMElement | |
| 68 | 72 | */ | 
| 69 | 73 | public function createElementNS($namespaceURI, $qualifiedName, $value = null); | 
| 70 | 74 | |
| 71 | 75 | /** | 
| 72 | 76 | * @param XMLDocumentInterface $child The element to remove. | 
| 73 | 77 | * | 
| 74 | - * @return mixed | |
| 78 | + * @return \DOMNode | |
| 75 | 79 | */ | 
| 76 | 80 | public function removeNode(XMLDocumentInterface $child); | 
| 77 | 81 | |
| @@ -79,7 +79,7 @@ | ||
| 79 | 79 | return 'rect'; | 
| 80 | 80 | } | 
| 81 | 81 | |
| 82 | - public static function union(array $rect1 , array $rect2) | |
| 82 | + public static function union(array $rect1, array $rect2) | |
| 83 | 83 |      { | 
| 84 | 84 | $result['x'] = min($rect1['x'], $rect2['x']); | 
| 85 | 85 | $result['y'] = min($rect1['y'], $rect2['y']); |