1<?php
2
3namespace jucksearm\barcode;
4
5use jucksearm\barcode\lib\BarcodeFactory;
6
7class Barcode
8{
9	public static function factory() {
10		return new BarcodeFactory();
11	}
12
13	public static function html(
14		$code,
15		$type,
16		$scale = null,
17		$height = null,
18		$rotate = null,
19		$color = null
20	) {
21		$barcodeFactory = self::factory()
22		  ->setCode($code)
23		  ->setType($type)
24		  ->setScale($scale)
25		  ->setHeight($height)
26		  ->setRotate($rotate)
27		  ->setColor($color)
28		  ->renderHTML();
29	}
30
31	public static function png(
32		$code,
33		$type,
34		$file = null,
35		$scale = null,
36		$height = null,
37		$rotate = null,
38		$color = null
39	) {
40		$barcodeFactory = self::factory()
41		  ->setCode($code)
42		  ->setType($type)
43		  ->setFile($file)
44		  ->setScale($scale)
45		  ->setHeight($height)
46		  ->setRotate($rotate)
47		  ->setColor($color)
48		  ->renderPNG();
49	}
50
51	public static function svg(
52		$code,
53		$type,
54		$file = null,
55		$scale = null,
56		$height = null,
57		$rotate = null,
58		$color = null
59	) {
60		$barcodeFactory = self::factory()
61		  ->setCode($code)
62		  ->setType($type)
63		  ->setFile($file)
64		  ->setScale($scale)
65		  ->setHeight($height)
66		  ->setRotate($rotate)
67		  ->setColor($color)
68		  ->renderSVG();
69	}
70}