@@ -31,49 +31,49 @@ |
||
31 | 31 | ); |
32 | 32 | |
33 | 33 | $l->setTemplateFile(dirname(__FILE__) . '/invoice.docx') |
34 | - ->setData([ |
|
35 | - 'company' => [ |
|
36 | - 'name' => 'Galaxy Finance', |
|
37 | - 'address' => 'PK 15 Road of Boali', |
|
38 | - 'phone' => '+236-72000000', |
|
39 | - ], |
|
40 | - 'customer' => [ |
|
41 | - 'name' => 'Banabool Kitoko', |
|
42 | - 'phone' => '+236-75111111', |
|
43 | - 'email' => '[email protected]', |
|
44 | - ], |
|
45 | - 'invoice' => [ |
|
46 | - 'no' => '2021090500033', |
|
47 | - 'date' => '2021-09-05 11:25:08', |
|
48 | - 'sub_total' => '3,450 FCFA', |
|
49 | - 'tax' => '19 %', |
|
50 | - 'total_amount' => '4,105 FCFA', |
|
51 | - 'due_days' => 15, |
|
52 | - ], |
|
53 | - 'items' => [ |
|
54 | - [ |
|
55 | - 'no' => 1, |
|
56 | - 'name' => 'Savon', |
|
57 | - 'price' => 250, |
|
58 | - 'quantity' => 2, |
|
59 | - 'total' => 500, |
|
60 | - ], |
|
61 | - [ |
|
62 | - 'no' => 2, |
|
63 | - 'name' => 'Sucre', |
|
64 | - 'price' => 500, |
|
65 | - 'quantity' => 5, |
|
66 | - 'total' => 2500, |
|
67 | - ], |
|
68 | - [ |
|
69 | - 'no' => 3, |
|
70 | - 'name' => 'Omo', |
|
71 | - 'price' => 150, |
|
72 | - 'quantity' => 3, |
|
73 | - 'total' => 450, |
|
74 | - ] |
|
75 | - ], |
|
76 | - ]); |
|
34 | + ->setData([ |
|
35 | + 'company' => [ |
|
36 | + 'name' => 'Galaxy Finance', |
|
37 | + 'address' => 'PK 15 Road of Boali', |
|
38 | + 'phone' => '+236-72000000', |
|
39 | + ], |
|
40 | + 'customer' => [ |
|
41 | + 'name' => 'Banabool Kitoko', |
|
42 | + 'phone' => '+236-75111111', |
|
43 | + 'email' => '[email protected]', |
|
44 | + ], |
|
45 | + 'invoice' => [ |
|
46 | + 'no' => '2021090500033', |
|
47 | + 'date' => '2021-09-05 11:25:08', |
|
48 | + 'sub_total' => '3,450 FCFA', |
|
49 | + 'tax' => '19 %', |
|
50 | + 'total_amount' => '4,105 FCFA', |
|
51 | + 'due_days' => 15, |
|
52 | + ], |
|
53 | + 'items' => [ |
|
54 | + [ |
|
55 | + 'no' => 1, |
|
56 | + 'name' => 'Savon', |
|
57 | + 'price' => 250, |
|
58 | + 'quantity' => 2, |
|
59 | + 'total' => 500, |
|
60 | + ], |
|
61 | + [ |
|
62 | + 'no' => 2, |
|
63 | + 'name' => 'Sucre', |
|
64 | + 'price' => 500, |
|
65 | + 'quantity' => 5, |
|
66 | + 'total' => 2500, |
|
67 | + ], |
|
68 | + [ |
|
69 | + 'no' => 3, |
|
70 | + 'name' => 'Omo', |
|
71 | + 'price' => 150, |
|
72 | + 'quantity' => 3, |
|
73 | + 'total' => 450, |
|
74 | + ] |
|
75 | + ], |
|
76 | + ]); |
|
77 | 77 | $l->process(); |
78 | 78 | $l->convert(); |
79 | 79 |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * @class DocxExtractorInterface |
54 | 54 | * @package Platine\DocxTemplate |
55 | 55 | */ |
56 | -interface DocxExtractorInterface |
|
57 | -{ |
|
56 | +interface DocxExtractorInterface { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * Extract an archive to the given destination |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * @class ArchiveInfo |
51 | 51 | * @package Platine\DocxTemplate\Archive |
52 | 52 | */ |
53 | -class ArchiveInfo |
|
54 | -{ |
|
53 | +class ArchiveInfo { |
|
55 | 54 | /** |
56 | 55 | * The archive name |
57 | 56 | * @var string |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | * @param int $mtime |
91 | 90 | * @param int $crc |
92 | 91 | */ |
93 | - public function __construct(string $name, int $index, int $size, int $mtime, int $crc) |
|
94 | - { |
|
92 | + public function __construct(string $name, int $index, int $size, int $mtime, int $crc) { |
|
95 | 93 | $this->name = $name; |
96 | 94 | $this->index = $index; |
97 | 95 | $this->size = $size; |
@@ -84,7 +84,7 @@ |
||
84 | 84 | ZipArchive::CREATE | ZipArchive::OVERWRITE |
85 | 85 | ); |
86 | 86 | if ($create === true) { |
87 | - // Create recursive directory iterator |
|
87 | + // Create recursive directory iterator |
|
88 | 88 | $files = new RecursiveIteratorIterator( |
89 | 89 | new RecursiveDirectoryIterator( |
90 | 90 | $folder, |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | * @class Zip |
58 | 58 | * @package Platine\DocxTemplate\Archive |
59 | 59 | */ |
60 | -class Zip implements DocxExtractorInterface |
|
61 | -{ |
|
60 | +class Zip implements DocxExtractorInterface { |
|
62 | 61 | /** |
63 | 62 | * The zip archive instance |
64 | 63 | * @var ZipArchive |
@@ -69,8 +68,7 @@ discard block |
||
69 | 68 | * Create new instance |
70 | 69 | * @param ZipArchive|null $zip |
71 | 70 | */ |
72 | - public function __construct(?ZipArchive $zip = null) |
|
73 | - { |
|
71 | + public function __construct(?ZipArchive $zip = null) { |
|
74 | 72 | $this->zip = $zip ?? new ZipArchive(); |
75 | 73 | } |
76 | 74 |
@@ -52,8 +52,7 @@ |
||
52 | 52 | * @class NullExtractor |
53 | 53 | * @package Platine\DocxTemplate\Archive |
54 | 54 | */ |
55 | -class NullExtractor implements DocxExtractorInterface |
|
56 | -{ |
|
55 | +class NullExtractor implements DocxExtractorInterface { |
|
57 | 56 | /** |
58 | 57 | * {@inheritodc} |
59 | 58 | */ |
@@ -39,6 +39,5 @@ |
||
39 | 39 | * @class DocxArchiveException |
40 | 40 | * @package Platine\DocxTemplate\Exception |
41 | 41 | */ |
42 | -class DocxArchiveException extends Exception |
|
43 | -{ |
|
42 | +class DocxArchiveException extends Exception { |
|
44 | 43 | } |