Skip to content

Commit 02cf8ec

Browse files
authored
Release 23.2 (#44)
* Update version to 23.2.0 * Add PHPStan for linting * Simplify example * Strict compare with assertSame * Add tests for TimeOut
1 parent 3d60f0f commit 02cf8ec

File tree

117 files changed

+2724
-3500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+2724
-3500
lines changed

.github/workflows/php-versions.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,44 @@ on:
77
branches: [ master, main ]
88

99
jobs:
10-
run:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Validate composer.json and composer.lock
17+
run: composer validate
18+
19+
- name: Cache Composer packages
20+
id: composer-cache
21+
uses: actions/cache@v2
22+
with:
23+
path: vendor
24+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-php-
27+
28+
- name: Install dependencies
29+
if: steps.composer-cache.outputs.cache-hit != 'true'
30+
run: composer install --prefer-dist --no-progress --no-suggest
31+
32+
- name: Run test suite
33+
env:
34+
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
35+
run: composer run-script test
36+
37+
- name: Run linter
38+
run: composer run-script lint
39+
40+
test:
41+
needs: build
1142
runs-on: ${{ matrix.operating-system }}
1243
strategy:
1344
matrix:
1445
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
1546
# See: https://www.php.net/supported-versions
16-
php-versions: ['7.3', '8.0', '8.1']
47+
php-versions: ['7.4', '8.0', '8.1', '8.2']
1748
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1849
steps:
1950
- name: Checkout

.github/workflows/php.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ Configuration*.json
55
!Configuration.example.json
66

77
/.php-cs-fixer.cache
8+
/.phpunit.cache
9+
phpunit.log

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
.PHONY: all
2-
all: format test
2+
all: format lint test
33

44
.PHONY: format
55
format:
66
composer format
77

8+
.PHONY: lint
9+
lint:
10+
composer lint
11+
812
.PHONY: test
913
test:
1014
composer test
1115

1216
.PHONY: init
1317
init:
1418
composer install
15-
composer global require friendsofphp/php-cs-fixer
1619

1720
.PHONY: update
1821
update:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
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: 23.1.0
10-
- Supported PHP versions: ">=7.3 || >=8.0"
9+
- Package version: 23.2.0
10+
- Supported PHP versions: ">=7.4 || >=8.0"
1111

1212
## Demo applications
1313

@@ -90,7 +90,7 @@ Class | Method | HTTP request | Description
9090
----- | ------ | ------------ | -----------
9191
*BarcodeApi* | [**getBarcodeGenerate**](docs/Api/BarcodeApi.md#getbarcodegenerate) | **GET** /barcode/generate | Generate barcode.
9292
*BarcodeApi* | [**getBarcodeRecognize**](docs/Api/BarcodeApi.md#getbarcoderecognize) | **GET** /barcode/{name}/recognize | Recognize barcode from a file on server.
93-
*BarcodeApi* | [**postBarcodeRecognizeFromUrlOrContent**](docs/Api/BarcodeApi.md#postbarcoderecognizefromurlorcontent) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
93+
*BarcodeApi* | [**postBarcodeRecognizeFromUrlOrContent**](docs/Api/BarcodeApi.md#postbarcoderecognizefromurlorcontent) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field.
9494
*BarcodeApi* | [**postGenerateMultiple**](docs/Api/BarcodeApi.md#postgeneratemultiple) | **POST** /barcode/generateMultiple | Generate multiple barcodes and return in response stream
9595
*BarcodeApi* | [**putBarcodeGenerateFile**](docs/Api/BarcodeApi.md#putbarcodegeneratefile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
9696
*BarcodeApi* | [**putBarcodeRecognizeFromBody**](docs/Api/BarcodeApi.md#putbarcoderecognizefrombody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,23 @@
125125
}
126126
],
127127
"require": {
128-
"php": ">=7.3 || >=8.0",
128+
"php": ">=7.4 || >=8.0",
129129
"guzzlehttp/guzzle": ">=6",
130130
"ext-json": "*"
131131
},
132132
"require-dev": {
133133
"phpunit/phpunit": ">=7.5.20",
134-
"friendsofphp/php-cs-fixer": ">=2.16"
134+
"friendsofphp/php-cs-fixer": ">=2.16",
135+
"phpstan/phpstan": "^1.9"
135136
},
136137
"autoload": {
137138
"psr-4": {
138139
"Aspose\\": "src/Aspose/"
139140
}
140141
},
141142
"scripts": {
142-
"format": "php-cs-fixer fix index.php && php-cs-fixer fix src/Aspose/ && php-cs-fixer fix tests/",
143-
"test": "phpunit --testdox tests"
143+
"format": "php-cs-fixer fix index.php src/Aspose/ tests/ --config=php-cs-fixer.conf",
144+
"lint": "phpstan analyse index.php src/ tests/ --level=3",
145+
"test": "phpunit"
144146
}
145147
}

docs/Api/BarcodeApi.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**getBarcodeGenerate**](BarcodeApi.md#getBarcodeGenerate) | **GET** /barcode/generate | Generate barcode.
88
[**getBarcodeRecognize**](BarcodeApi.md#getBarcodeRecognize) | **GET** /barcode/{name}/recognize | Recognize barcode from a file on server.
9-
[**postBarcodeRecognizeFromUrlOrContent**](BarcodeApi.md#postBarcodeRecognizeFromUrlOrContent) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
9+
[**postBarcodeRecognizeFromUrlOrContent**](BarcodeApi.md#postBarcodeRecognizeFromUrlOrContent) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field.
1010
[**postGenerateMultiple**](BarcodeApi.md#postGenerateMultiple) | **POST** /barcode/generateMultiple | Generate multiple barcodes and return in response stream
1111
[**putBarcodeGenerateFile**](BarcodeApi.md#putBarcodeGenerateFile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
1212
[**putBarcodeRecognizeFromBody**](BarcodeApi.md#putBarcodeRecognizeFromBody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.
@@ -161,7 +161,7 @@ $rect_y = 56; // int | Set Y for area for recognition.
161161
$rect_width = 56; // int | Set Width of area for recognition.
162162
$rect_height = 56; // int | Set Height of area for recognition.
163163
$strip_fnc = true; // bool | Value indicating whether FNC symbol strip must be done.
164-
$timeout = 56; // int | Timeout of recognition process.
164+
$timeout = 56; // int | Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout.
165165
$median_smoothing_window_size = 56; // int | Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set.
166166
$allow_median_smoothing = true; // bool | Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes.
167167
$allow_complex_background = true; // bool | Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode.
@@ -185,7 +185,7 @@ $similarity = 1.2; // double | Similarity coefficient depends on how homogeneous
185185
$skip_diagonal_search = true; // bool | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time.
186186
$read_tiny_barcodes = true; // bool | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False.
187187
$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
188-
$ignore_ending_filling_patterns_for_c_table = true; // bool | The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\".
188+
$ignore_ending_filling_patterns_for_c_table = true; // bool | The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\".
189189
$rectangle_region = "rectangle_region_example"; // string |
190190
$storage = "storage_example"; // string | The image storage.
191191
$folder = "folder_example"; // string | The image folder.
@@ -213,7 +213,7 @@ Name | Type | Description | Notes
213213
**rect_width** | **int**| Set Width of area for recognition. | [optional]
214214
**rect_height** | **int**| Set Height of area for recognition. | [optional]
215215
**strip_fnc** | **bool**| Value indicating whether FNC symbol strip must be done. | [optional]
216-
**timeout** | **int**| Timeout of recognition process. | [optional]
216+
**timeout** | **int**| Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional]
217217
**median_smoothing_window_size** | **int**| Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. | [optional]
218218
**allow_median_smoothing** | **bool**| Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. | [optional]
219219
**allow_complex_background** | **bool**| Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. | [optional]
@@ -237,7 +237,7 @@ Name | Type | Description | Notes
237237
**skip_diagonal_search** | **bool**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
238238
**read_tiny_barcodes** | **bool**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
239239
**australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional]
240-
**ignore_ending_filling_patterns_for_c_table** | **bool**| The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\". | [optional]
240+
**ignore_ending_filling_patterns_for_c_table** | **bool**| The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". | [optional]
241241
**rectangle_region** | **string**| | [optional]
242242
**storage** | **string**| The image storage. | [optional]
243243
**folder** | **string**| The image folder. | [optional]
@@ -260,7 +260,7 @@ Name | Type | Description | Notes
260260
# **postBarcodeRecognizeFromUrlOrContent**
261261
> \Aspose\BarCode\Model\BarcodeResponseList postBarcodeRecognizeFromUrlOrContent($type, $checksum_validation, $detect_encoding, $preset, $rect_x, $rect_y, $rect_width, $rect_height, $strip_fnc, $timeout, $median_smoothing_window_size, $allow_median_smoothing, $allow_complex_background, $allow_datamatrix_industrial_barcodes, $allow_decreased_image, $allow_detect_scan_gap, $allow_incorrect_barcodes, $allow_invert_image, $allow_micro_white_spots_removing, $allow_one_d_fast_barcodes_detector, $allow_one_d_wiped_bars_restoration, $allow_qr_micro_qr_restoration, $allow_regular_image, $allow_salt_and_pepper_filtering, $allow_white_spots_removing, $check_more1_d_variants, $fast_scan_only, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $read_tiny_barcodes, $australian_post_encoding_table, $ignore_ending_filling_patterns_for_c_table, $rectangle_region, $url, $image)
262262
263-
Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
263+
Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field.
264264

265265
### Example
266266
```php
@@ -285,7 +285,7 @@ $rect_y = 56; // int | Set Y for area for recognition.
285285
$rect_width = 56; // int | Set Width of area for recognition.
286286
$rect_height = 56; // int | Set Height of area for recognition.
287287
$strip_fnc = true; // bool | Value indicating whether FNC symbol strip must be done.
288-
$timeout = 56; // int | Timeout of recognition process.
288+
$timeout = 56; // int | Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout.
289289
$median_smoothing_window_size = 56; // int | Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set.
290290
$allow_median_smoothing = true; // bool | Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes.
291291
$allow_complex_background = true; // bool | Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode.
@@ -309,7 +309,7 @@ $similarity = 1.2; // double | Similarity coefficient depends on how homogeneous
309309
$skip_diagonal_search = true; // bool | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time.
310310
$read_tiny_barcodes = true; // bool | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False.
311311
$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
312-
$ignore_ending_filling_patterns_for_c_table = true; // bool | The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\".
312+
$ignore_ending_filling_patterns_for_c_table = true; // bool | The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\".
313313
$rectangle_region = "rectangle_region_example"; // string |
314314
$url = "url_example"; // string | The image file url.
315315
$image = "/path/to/file.txt"; // \SplFileObject | Image data
@@ -336,7 +336,7 @@ Name | Type | Description | Notes
336336
**rect_width** | **int**| Set Width of area for recognition. | [optional]
337337
**rect_height** | **int**| Set Height of area for recognition. | [optional]
338338
**strip_fnc** | **bool**| Value indicating whether FNC symbol strip must be done. | [optional]
339-
**timeout** | **int**| Timeout of recognition process. | [optional]
339+
**timeout** | **int**| Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional]
340340
**median_smoothing_window_size** | **int**| Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. | [optional]
341341
**allow_median_smoothing** | **bool**| Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. | [optional]
342342
**allow_complex_background** | **bool**| Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. | [optional]
@@ -360,7 +360,7 @@ Name | Type | Description | Notes
360360
**skip_diagonal_search** | **bool**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
361361
**read_tiny_barcodes** | **bool**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
362362
**australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional]
363-
**ignore_ending_filling_patterns_for_c_table** | **bool**| The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\". | [optional]
363+
**ignore_ending_filling_patterns_for_c_table** | **bool**| The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". | [optional]
364364
**rectangle_region** | **string**| | [optional]
365365
**url** | **string**| The image file url. | [optional]
366366
**image** | **\SplFileObject**| Image data | [optional]

0 commit comments

Comments
 (0)