diff --git a/Models/Guidelines/GS1Datamatrix.php b/Models/Guidelines/GS1Datamatrix.php index 8ba4adf..2512f70 100644 --- a/Models/Guidelines/GS1Datamatrix.php +++ b/Models/Guidelines/GS1Datamatrix.php @@ -550,6 +550,13 @@ class GS1Datamatrix public array $data = []; + /** + * Validate GS1 data + * + * @return bool + * + * @since 1.0.0 + */ public function validate() : bool { if (empty($this->data['01'] ?? '')) { @@ -565,6 +572,13 @@ class GS1Datamatrix return true; } + /** + * Render GS1 string representation + * + * @return string + * + * @since 1.0.0 + */ public function renderString() : string { $text = ''; @@ -576,6 +590,13 @@ class GS1Datamatrix return $text; } + /** + * Render internal GS1 string used for datamatrix etc. + * + * @return string + * + * @since 1.0.0 + */ public function renderCodeString() : string { // 232 = FNC1 = ]C1 diff --git a/Models/Label.php b/Models/Label.php index 7114187..34f8f22 100644 --- a/Models/Label.php +++ b/Models/Label.php @@ -34,6 +34,13 @@ class Label public array $elements = []; + /** + * Render label + * + * @return null|\GdImage + * + * @since 1.0.0 + */ public function render() : ?\GdImage { $im = \imagecreatetruecolor((int) (37.8 * $this->width), (int) (37.8 * $this->height)); @@ -58,6 +65,7 @@ class Label foreach ($this->elements as $element) { $color = 0; + // @todo: replace int type with enum if ($element instanceof Shape) { if ($element->type === 1) { // Line @@ -88,9 +96,9 @@ class Label $bg ); } - } elseif ($element->type === 3) { - } elseif ($element->type === 4) { } + + // @todo: implement circle + elipse } elseif ($element instanceof Text) { \imagettftext($im, $element->size, 0, $element->x, $element->y, $color, $element->font, $element->text); } elseif ($element instanceof Image) {