# woocommerce-pos/1.10.7/vendor_prefixed/picqer/php-barcode-generator/src/Barcode.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.7. 38 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.7/code/vendor_prefixed/picqer/php-barcode-generator/src/Barcode.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.7/raw/vendor_prefixed/picqer/php-barcode-generator/src/Barcode.php
- Modified: 2026-06-09T13:55:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.7/code/vendor_prefixed/picqer/php-barcode-generator/src/Barcode.php#L10-L20`.

```php
<?php

namespace WCPOS\Vendor\Picqer\Barcode;

class Barcode
{
    protected $barcode;
    protected $width = 0;
    protected $height = 0;
    protected $bars = [];
    public function __construct(string $barcode)
    {
        $this->barcode = $barcode;
    }
    public function addBar(BarcodeBar $bar)
    {
        $this->bars[] = $bar;
        $this->width += $bar->getWidth();
        $this->height = \max($this->height, $bar->getHeight());
    }
    public function getBarcode() : string
    {
        return $this->barcode;
    }
    public function getWidth() : int
    {
        return $this->width;
    }
    public function getHeight() : int
    {
        return $this->height;
    }
    public function getBars() : array
    {
        return $this->bars;
    }
}

```
