Closed Axent96 closed 4 years ago
Yes, it would be better to have some interface or not extend from the base generator. I played with this with version 2.0, but the image generators (jpg and png) have other options and naming then the vector based generators (html and svg). That is why I could not make the interface the same.
With version 2 I started some refactoring to make it possible to feed the barcode type class directly into the generators. Then there is no central class or factory where everything should be the same. Then the image and vector generators can have a slight different interface.
If someone has a better idea, please let me know.
Each generator extends from "BarcodeGenerator" without some interface. For this case we need the abstract function "getBarcode" or some general interface for the generators:
use Picqer\Barcode\BarcodeGeneratorHTML; use Picqer\Barcode\BarcodeGeneratorJPG; use Picqer\Barcode\BarcodeGeneratorPNG; use Picqer\Barcode\BarcodeGeneratorSVG;
phpstan say: