Skip to content

Commit b90eee2

Browse files
authored
Release 24.9 (#74)
* Update documentation * Add checksumValidation * Add test for Code39 type without checksum * Update version to 24.9.0
1 parent e8ead54 commit b90eee2

15 files changed

+201
-103
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/aspose/barcode-cloud-php/php)](https://packagist.org/packages/aspose/barcode-cloud-php)
77

88
- API version: 3.0
9-
- Package version: 24.8.0
9+
- Package version: 24.9.0
1010
- Supported PHP versions: ">=7.4 || >=8.0"
1111

1212
## Demo applications

docs/Api/BarcodeApi.md

Lines changed: 24 additions & 26 deletions
Large diffs are not rendered by default.

docs/Model/CaptionParams.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
---- | ---- | ----------- | -----
88
**text** | **string** | Caption text. | [optional]
99
**alignment** | [**\Aspose\BarCode\Model\TextAlignment**](TextAlignment.md) | Text alignment. | [optional]
10-
**color** | **string** | Text color. | [optional]
10+
**color** | **string** | Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional]
1111
**visible** | **bool** | Is caption visible. | [optional]
1212
**font** | [**\Aspose\BarCode\Model\FontParams**](FontParams.md) | Font. | [optional]
1313
**padding** | [**\Aspose\BarCode\Model\Padding**](Padding.md) | Padding. | [optional]

docs/Model/GeneratorParams.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
1010
**two_d_display_text** | **string** | Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode | [optional]
1111
**text_location** | [**\Aspose\BarCode\Model\CodeLocation**](CodeLocation.md) | Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. | [optional]
1212
**text_alignment** | [**\Aspose\BarCode\Model\TextAlignment**](TextAlignment.md) | Text alignment. | [optional]
13-
**text_color** | **string** | Specify the displaying CodeText's Color. Default value: Color.Black. | [optional]
13+
**text_color** | **string** | Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional]
1414
**font** | [**\Aspose\BarCode\Model\FontParams**](FontParams.md) | Specify the displaying Text's font. Default value: Arial 5pt regular. Ignored if FontSizeMode is set to FontSizeMode.Auto. | [optional]
1515
**font_size_mode** | [**\Aspose\BarCode\Model\FontMode**](FontMode.md) | Specify FontSizeMode. If FontSizeMode is set to Auto, font size will be calculated automatically based on xDimension value. It is recommended to use FontSizeMode.Auto especially in AutoSizeMode.Nearest or AutoSizeMode.Interpolation. Default value: FontSizeMode.Auto. | [optional]
1616
**no_wrap** | **bool** | Specify word wraps (line breaks) within text. Default value: false. | [optional]
@@ -28,9 +28,9 @@ Name | Type | Description | Notes
2828
**padding** | [**\Aspose\BarCode\Model\Padding**](Padding.md) | Barcode paddings. Default value: 5pt 5pt 5pt 5pt. | [optional]
2929
**caption_above** | [**\Aspose\BarCode\Model\CaptionParams**](CaptionParams.md) | Additional caption above barcode. | [optional]
3030
**caption_below** | [**\Aspose\BarCode\Model\CaptionParams**](CaptionParams.md) | Additional caption below barcode. | [optional]
31-
**back_color** | **string** | Background color of the barcode image. Default value: Color.White. | [optional]
32-
**bar_color** | **string** | Bars color. Default value: Color.Black. | [optional]
33-
**border_color** | **string** | Border color. Default value: Color.Black. | [optional]
31+
**back_color** | **string** | Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional]
32+
**bar_color** | **string** | Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional]
33+
**border_color** | **string** | Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional]
3434
**border_width** | **double** | Border width. Default value: 0. Ignored if Visible is set to false. | [optional]
3535
**border_dash_style** | [**\Aspose\BarCode\Model\BorderDashStyle**](BorderDashStyle.md) | Border dash style. Default value: BorderDashStyle.Solid. | [optional]
3636
**border_visible** | **bool** | Border visibility. If false than parameter Width is always ignored (0). Default value: false. | [optional]
@@ -59,7 +59,7 @@ Name | Type | Description | Notes
5959
**postal** | [**\Aspose\BarCode\Model\PostalParams**](PostalParams.md) | Postal params. | [optional]
6060
**qr** | [**\Aspose\BarCode\Model\QrParams**](QrParams.md) | QR params. | [optional]
6161
**patch_code** | [**\Aspose\BarCode\Model\PatchCodeParams**](PatchCodeParams.md) | PatchCode params. | [optional]
62-
**code128** | [**\Aspose\BarCode\Model\Code128Params**](Code128Params.md) | Code128 params. | [optional]
62+
**code128** | [**\Aspose\BarCode\Model\Code128Params**](Code128Params.md) | Code128 parameters | [optional]
6363
**han_xin** | [**\Aspose\BarCode\Model\HanXinParams**](HanXinParams.md) | HanXin params. | [optional]
6464

6565
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

src/Aspose/BarCode/BarcodeApi.php

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,6 @@ protected function GetBarcodeGenerateRequest(Requests\GetBarcodeGenerateRequest
335335
$queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue);
336336
}
337337
}
338-
if (isset($request->font_size_mode)) {
339-
$queryParamName = lcfirst('FontSizeMode');
340-
$queryParamValue = is_bool($request->font_size_mode) ? ($request->font_size_mode ? 'true' : 'false') : $request->font_size_mode;
341-
if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) {
342-
$resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath);
343-
} else {
344-
$queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue);
345-
}
346-
}
347338
if (isset($request->no_wrap)) {
348339
$queryParamName = lcfirst('NoWrap');
349340
$queryParamValue = is_bool($request->no_wrap) ? ($request->no_wrap ? 'true' : 'false') : $request->no_wrap;
@@ -1741,6 +1732,7 @@ protected function PostBarcodeRecognizeFromUrlOrContentRequest(Requests\PostBarc
17411732
$handle = fopen($filename, 'rb');
17421733
$fsize = filesize($filename);
17431734
$contents = fread($handle, $fsize);
1735+
$fileField = 'image';
17441736
$formParams['image'][] = $contents;
17451737
// body params
17461738
$_tempBody = null;
@@ -1760,11 +1752,25 @@ protected function PostBarcodeRecognizeFromUrlOrContentRequest(Requests\PostBarc
17601752
if ($multipart) {
17611753
$multipartContents = [];
17621754
foreach ($formParams as $formParamName => $formParamValues) {
1763-
foreach ($formParamValues as $formParamValue) {
1755+
if (is_array($formParamValues)) {
1756+
foreach ($formParamValues as $formParamValue) {
1757+
if ($formParamName === $fileField) {
1758+
$multipartContents[] = [
1759+
'name' => $formParamName,
1760+
'contents' => $formParamValue,
1761+
'filename' => $filename
1762+
];
1763+
} else {
1764+
$multipartContents[] = [
1765+
'name' => $formParamName,
1766+
'contents' => $formParamValue,
1767+
];
1768+
}
1769+
}
1770+
} else {
17641771
$multipartContents[] = [
17651772
'name' => $formParamName,
1766-
'contents' => $formParamValue,
1767-
'filename' => $filename
1773+
'contents' => $formParamValues,
17681774
];
17691775
}
17701776
}
@@ -2324,15 +2330,6 @@ protected function PutBarcodeGenerateFileRequest(Requests\PutBarcodeGenerateFile
23242330
$queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue);
23252331
}
23262332
}
2327-
if (isset($request->font_size_mode)) {
2328-
$queryParamName = lcfirst('FontSizeMode');
2329-
$queryParamValue = is_bool($request->font_size_mode) ? ($request->font_size_mode ? 'true' : 'false') : $request->font_size_mode;
2330-
if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) {
2331-
$resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath);
2332-
} else {
2333-
$queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue);
2334-
}
2335-
}
23362333
if (isset($request->no_wrap)) {
23372334
$queryParamName = lcfirst('NoWrap');
23382335
$queryParamValue = is_bool($request->no_wrap) ? ($request->no_wrap ? 'true' : 'false') : $request->no_wrap;
@@ -3433,14 +3430,19 @@ protected function ScanBarcodeRequest(Requests\ScanBarcodeRequest $request)
34333430
$handle = fopen($filename, 'rb');
34343431
$fsize = filesize($filename);
34353432
$contents = fread($handle, $fsize);
3433+
$fileField = 'imageFile';
34363434
$formParams['imageFile'][] = $contents;
34373435

3438-
foreach($request->decode_types as $item) {
3436+
foreach ($request->decode_types as $item) {
34393437
$formParams['decodeTypes'][] = ObjectSerializer::toFormValue($item);
34403438
}
34413439

34423440
if (isset($request->timeout)) {
3443-
$formParams['timeout'][] = ObjectSerializer::toFormValue($request->timeout);
3441+
$formParams['timeout'] = ObjectSerializer::toFormValue($request->timeout);
3442+
}
3443+
3444+
if (isset($request->checksum_validation)) {
3445+
$formParams['checksumValidation'] = ObjectSerializer::toFormValue($request->checksum_validation);
34443446
}
34453447
// body params
34463448
$_tempBody = null;
@@ -3460,11 +3462,25 @@ protected function ScanBarcodeRequest(Requests\ScanBarcodeRequest $request)
34603462
if ($multipart) {
34613463
$multipartContents = [];
34623464
foreach ($formParams as $formParamName => $formParamValues) {
3463-
foreach ($formParamValues as $formParamValue) {
3465+
if (is_array($formParamValues)) {
3466+
foreach ($formParamValues as $formParamValue) {
3467+
if ($formParamName === $fileField) {
3468+
$multipartContents[] = [
3469+
'name' => $formParamName,
3470+
'contents' => $formParamValue,
3471+
'filename' => $filename
3472+
];
3473+
} else {
3474+
$multipartContents[] = [
3475+
'name' => $formParamName,
3476+
'contents' => $formParamValue,
3477+
];
3478+
}
3479+
}
3480+
} else {
34643481
$multipartContents[] = [
34653482
'name' => $formParamName,
3466-
'contents' => $formParamValue,
3467-
'filename' => $filename
3483+
'contents' => $formParamValues,
34683484
];
34693485
}
34703486
}

src/Aspose/BarCode/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Configuration implements JsonSerializable
2020
*
2121
* @var string
2222
*/
23-
protected $clientVersion = '24.8.0';
23+
protected $clientVersion = '24.9.0';
2424

2525
/**
2626
* ClientId for API

src/Aspose/BarCode/FileApi.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ protected function UploadFileRequest(Requests\UploadFileRequest $request)
12491249
$handle = fopen($filename, 'rb');
12501250
$fsize = filesize($filename);
12511251
$contents = fread($handle, $fsize);
1252+
$fileField = 'File';
12521253
$formParams['File'][] = $contents;
12531254
// body params
12541255
$_tempBody = null;
@@ -1268,11 +1269,25 @@ protected function UploadFileRequest(Requests\UploadFileRequest $request)
12681269
if ($multipart) {
12691270
$multipartContents = [];
12701271
foreach ($formParams as $formParamName => $formParamValues) {
1271-
foreach ($formParamValues as $formParamValue) {
1272+
if (is_array($formParamValues)) {
1273+
foreach ($formParamValues as $formParamValue) {
1274+
if ($formParamName === $fileField) {
1275+
$multipartContents[] = [
1276+
'name' => $formParamName,
1277+
'contents' => $formParamValue,
1278+
'filename' => $filename
1279+
];
1280+
} else {
1281+
$multipartContents[] = [
1282+
'name' => $formParamName,
1283+
'contents' => $formParamValue,
1284+
];
1285+
}
1286+
}
1287+
} else {
12721288
$multipartContents[] = [
12731289
'name' => $formParamName,
1274-
'contents' => $formParamValue,
1275-
'filename' => $filename
1290+
'contents' => $formParamValues,
12761291
];
12771292
}
12781293
}

src/Aspose/BarCode/Model/CaptionParams.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function getColor()
273273
/**
274274
* Sets color
275275
*
276-
* @param string $color Text color.
276+
* @param string $color Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
277277
*
278278
* @return $this
279279
*/

src/Aspose/BarCode/Model/GeneratorParams.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ public function getTextColor()
651651
/**
652652
* Sets text_color
653653
*
654-
* @param string $text_color Specify the displaying CodeText's Color. Default value: Color.Black.
654+
* @param string $text_color Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
655655
*
656656
* @return $this
657657
*/
@@ -1085,7 +1085,7 @@ public function getBackColor()
10851085
/**
10861086
* Sets back_color
10871087
*
1088-
* @param string $back_color Background color of the barcode image. Default value: Color.White.
1088+
* @param string $back_color Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
10891089
*
10901090
* @return $this
10911091
*/
@@ -1109,7 +1109,7 @@ public function getBarColor()
11091109
/**
11101110
* Sets bar_color
11111111
*
1112-
* @param string $bar_color Bars color. Default value: Color.Black.
1112+
* @param string $bar_color Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
11131113
*
11141114
* @return $this
11151115
*/
@@ -1133,7 +1133,7 @@ public function getBorderColor()
11331133
/**
11341134
* Sets border_color
11351135
*
1136-
* @param string $border_color Border color. Default value: Color.Black.
1136+
* @param string $border_color Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
11371137
*
11381138
* @return $this
11391139
*/
@@ -1829,7 +1829,7 @@ public function getCode128()
18291829
/**
18301830
* Sets code128
18311831
*
1832-
* @param \Aspose\BarCode\Model\Code128Params $code128 Code128 params.
1832+
* @param \Aspose\BarCode\Model\Code128Params $code128 Code128 parameters
18331833
*
18341834
* @return $this
18351835
*/

0 commit comments

Comments
 (0)