summaryrefslogtreecommitdiffstats
path: root/36.patch
blob: 7500f91e424299f4b1b16f46452043218c4e4621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
From 70c29818f054a807e4f0cb16c041fe7cace32741 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 20 Oct 2017 13:00:34 +0200
Subject: [PATCH] Fix for php72 (object is a reserved keyword)

---
 src/Renderer/AbstractRenderer.php |  4 ++--
 test/FactoryTest.php              |  8 ++++----
 test/Renderer/ImageTest.php       | 32 ++++++++++++++++----------------
 test/Renderer/PdfTest.php         | 14 +++++++-------
 test/Renderer/TestCommon.php      | 20 ++++++++++----------
 5 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/src/Renderer/AbstractRenderer.php b/src/Renderer/AbstractRenderer.php
index ae02588..2263432 100644
--- a/src/Renderer/AbstractRenderer.php
+++ b/src/Renderer/AbstractRenderer.php
@@ -12,7 +12,7 @@
 use Traversable;
 use Zend\Barcode\Barcode;
 use Zend\Barcode\Exception as BarcodeException;
-use Zend\Barcode\Object;
+use Zend\Barcode\Object\ObjectInterface;
 use Zend\Stdlib\ArrayUtils;
 
 /**
@@ -327,7 +327,7 @@ public function getAutomaticRenderError()
      * @param  Object\ObjectInterface $barcode
      * @return AbstractRenderer
      */
-    public function setBarcode(Object\ObjectInterface $barcode)
+    public function setBarcode(ObjectInterface $barcode)
     {
         $this->barcode = $barcode;
         return $this;
diff --git a/test/FactoryTest.php b/test/FactoryTest.php
index 15e1ed6..742b7a0 100644
--- a/test/FactoryTest.php
+++ b/test/FactoryTest.php
@@ -13,7 +13,7 @@
 use Zend\Barcode;
 use Zend\Barcode\Exception\InvalidArgumentException;
 use Zend\Barcode\Renderer;
-use Zend\Barcode\Object;
+use Zend\Barcode\Object\Code25;
 use Zend\Config\Config;
 use Zend\ServiceManager\Exception\InvalidServiceException;
 use ZendPdf as Pdf;
@@ -159,14 +159,14 @@ public function testFactoryWithoutBarcodeWithAutomaticExceptionRenderWithZendCon
     public function testFactoryWithExistingBarcodeObject()
     {
         $this->checkGDRequirement();
-        $barcode = new Object\Code25();
+        $barcode = new Code25();
         $renderer = Barcode\Barcode::factory($barcode);
         $this->assertSame($barcode, $renderer->getBarcode());
     }
 
     public function testBarcodeObjectFactoryWithExistingBarcodeObject()
     {
-        $barcode = new Object\Code25();
+        $barcode = new Code25();
         $generatedBarcode = Barcode\Barcode::makeBarcode($barcode);
         $this->assertSame($barcode, $generatedBarcode);
     }
@@ -411,7 +411,7 @@ public function testProxyBarcodeRendererDrawAsSvgAutomaticallyRenderSvgIfExcepti
     public function testProxyBarcodeObjectFont()
     {
         Barcode\Barcode::setBarcodeFont('my_font.ttf');
-        $barcode = new Object\Code25();
+        $barcode = new Code25();
         $this->assertSame('my_font.ttf', $barcode->getFont());
         Barcode\Barcode::setBarcodeFont('');
     }
diff --git a/test/Renderer/ImageTest.php b/test/Renderer/ImageTest.php
index db32b33..e5c833c 100644
--- a/test/Renderer/ImageTest.php
+++ b/test/Renderer/ImageTest.php
@@ -10,7 +10,7 @@
 namespace ZendTest\Barcode\Renderer;
 
 use Zend\Barcode;
-use Zend\Barcode\Object;
+use Zend\Barcode\Object\Code39;
 use Zend\Barcode\Renderer as RendererNS;
 
 /**
@@ -99,7 +99,7 @@ public function testNonAllowedImageType()
     public function testDrawReturnResource()
     {
         $this->checkTTFRequirement();
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
         $resource = $this->renderer->draw();
         $this->assertInternalType('resource', $resource, 'Image must be a resource');
@@ -109,7 +109,7 @@ public function testDrawReturnResource()
     public function testDrawWithExistantResourceReturnResource()
     {
         $this->checkTTFRequirement();
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
         $imageResource = imagecreatetruecolor(500, 500);
         $this->renderer->setResource($imageResource);
@@ -121,7 +121,7 @@ public function testDrawWithExistantResourceReturnResource()
 
     public function testGoodUserHeight()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $this->renderer->setBarcode($barcode);
         $this->renderer->setHeight(62);
@@ -131,7 +131,7 @@ public function testGoodUserHeight()
     public function testBadUserHeightLessThanBarcodeHeight()
     {
         $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $this->renderer->setBarcode($barcode);
         $this->renderer->setHeight(61);
@@ -140,7 +140,7 @@ public function testBadUserHeightLessThanBarcodeHeight()
 
     public function testGoodUserWidth()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $this->renderer->setBarcode($barcode);
         $this->renderer->setWidth(211);
@@ -150,7 +150,7 @@ public function testGoodUserWidth()
     public function testBadUserWidthLessThanBarcodeWidth()
     {
         $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $this->renderer->setBarcode($barcode);
         $this->renderer->setWidth(210);
@@ -159,7 +159,7 @@ public function testBadUserWidthLessThanBarcodeWidth()
 
     public function testGoodHeightOfUserResource()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $imageResource = imagecreatetruecolor(500, 62);
         $this->renderer->setResource($imageResource);
@@ -170,7 +170,7 @@ public function testGoodHeightOfUserResource()
     public function testBadHeightOfUserResource()
     {
         $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $this->renderer->setBarcode($barcode);
         $imageResource = imagecreatetruecolor(500, 61);
@@ -180,7 +180,7 @@ public function testBadHeightOfUserResource()
 
     public function testGoodWidthOfUserResource()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $imageResource = imagecreatetruecolor(211, 500);
         $this->renderer->setResource($imageResource);
@@ -191,7 +191,7 @@ public function testGoodWidthOfUserResource()
     public function testBadWidthOfUserResource()
     {
         $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $this->renderer->setBarcode($barcode);
         $imageResource = imagecreatetruecolor(210, 500);
@@ -203,7 +203,7 @@ public function testNoFontWithOrientation()
     {
         $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
         Barcode\Barcode::setBarcodeFont(null);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $barcode->setOrientation(1);
         $this->renderer->setBarcode($barcode);
         $this->renderer->draw();
@@ -281,7 +281,7 @@ public function testTopOffsetOverrideVerticalPosition()
      */
     public function testImageGifWithNoTransparency()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
 
         $this->renderer->setTransparentBackground(false);
@@ -299,7 +299,7 @@ public function testImageGifWithNoTransparency()
      */
     public function testImagePngWithNoTransparency()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
 
         $this->renderer->setTransparentBackground(false);
@@ -317,7 +317,7 @@ public function testImagePngWithNoTransparency()
      */
     public function testImageGifWithTransparency()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
 
         $this->renderer->setTransparentBackground(true);
@@ -335,7 +335,7 @@ public function testImageGifWithTransparency()
      */
     public function testImagePngWithTransparency()
     {
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
 
         $this->renderer->setTransparentBackground(true);
diff --git a/test/Renderer/PdfTest.php b/test/Renderer/PdfTest.php
index 36ac49e..5b4c9fb 100644
--- a/test/Renderer/PdfTest.php
+++ b/test/Renderer/PdfTest.php
@@ -11,7 +11,7 @@
 
 use ZendPdf as Pdf;
 use Zend\Barcode;
-use Zend\Barcode\Object;
+use Zend\Barcode\Object\Code39;
 
 /**
  * @group      Zend_Barcode
@@ -45,7 +45,7 @@ public function testGoodPdfResource()
     public function testDrawReturnResource()
     {
         Barcode\Barcode::setBarcodeFont(__DIR__ . '/../Object/_fonts/Vera.ttf');
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
         $resource = $this->renderer->draw();
         $this->assertInstanceOf('ZendPdf\PdfDocument', $resource);
@@ -55,7 +55,7 @@ public function testDrawReturnResource()
     public function testDrawWithExistantResourceReturnResource()
     {
         Barcode\Barcode::setBarcodeFont(__DIR__ . '/../Object/_fonts/Vera.ttf');
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->renderer->setBarcode($barcode);
         $pdfResource = new Pdf\PdfDocument();
         $this->renderer->setResource($pdfResource);
@@ -75,7 +75,7 @@ protected function getRendererWithWidth500AndHeight300()
     public function testHorizontalPositionToCenter()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $renderer->setBarcode($barcode);
         $renderer->setHorizontalPosition('center');
@@ -86,7 +86,7 @@ public function testHorizontalPositionToCenter()
     public function testHorizontalPositionToRight()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $renderer->setBarcode($barcode);
         $renderer->setHorizontalPosition('right');
@@ -97,7 +97,7 @@ public function testHorizontalPositionToRight()
     public function testVerticalPositionToMiddle()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $renderer->setBarcode($barcode);
         $renderer->setVerticalPosition('middle');
@@ -108,7 +108,7 @@ public function testVerticalPositionToMiddle()
     public function testVerticalPositionToBottom()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $renderer->setBarcode($barcode);
         $renderer->setVerticalPosition('bottom');
diff --git a/test/Renderer/TestCommon.php b/test/Renderer/TestCommon.php
index f04e49f..a2de440 100644
--- a/test/Renderer/TestCommon.php
+++ b/test/Renderer/TestCommon.php
@@ -11,7 +11,7 @@
 
 use ZendTest\Barcode\Object\TestAsset as TestAsset;
 use Zend\Barcode;
-use Zend\Barcode\Object;
+use Zend\Barcode\Object\Code39;
 use Zend\Config;
 
 abstract class TestCommon extends \PHPUnit_Framework_TestCase
@@ -51,7 +51,7 @@ public function tearDown()
 
     public function testSetBarcodeObject()
     {
-        $barcode = new Object\Code39();
+        $barcode = new Code39();
         $this->renderer->setBarcode($barcode);
         $this->assertSame($barcode, $this->renderer->getBarcode());
     }
@@ -200,7 +200,7 @@ public function testHorizontalPositionToLeft()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $renderer->setBarcode($barcode);
         $renderer->draw();
@@ -211,7 +211,7 @@ public function testHorizontalPositionToCenter()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $renderer->setBarcode($barcode);
         $renderer->setHorizontalPosition('center');
@@ -223,7 +223,7 @@ public function testHorizontalPositionToRight()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $renderer->setBarcode($barcode);
         $renderer->setHorizontalPosition('right');
@@ -235,7 +235,7 @@ public function testLeftOffsetOverrideHorizontalPosition()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(211, $barcode->getWidth());
         $renderer->setBarcode($barcode);
         $renderer->setLeftOffset(12);
@@ -248,7 +248,7 @@ public function testVerticalPositionToTop()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $renderer->setBarcode($barcode);
         $renderer->setVerticalPosition('top');
@@ -260,7 +260,7 @@ public function testVerticalPositionToMiddle()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $renderer->setBarcode($barcode);
         $renderer->setVerticalPosition('middle');
@@ -272,7 +272,7 @@ public function testVerticalPositionToBottom()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $renderer->setBarcode($barcode);
         $renderer->setVerticalPosition('bottom');
@@ -284,7 +284,7 @@ public function testTopOffsetOverrideVerticalPosition()
     {
         $renderer = $this->getRendererWithWidth500AndHeight300();
         $renderer->setModuleSize(1);
-        $barcode = new Object\Code39(['text' => '0123456789']);
+        $barcode = new Code39(['text' => '0123456789']);
         $this->assertEquals(62, $barcode->getHeight());
         $renderer->setBarcode($barcode);
         $renderer->setTopOffset(12);