Skip to content

Commit a57bd2f

Browse files
♻️ 💥 🥃 apply more fixes and add whisky (#191)
1 parent 48925ea commit a57bd2f

15 files changed

Lines changed: 63 additions & 42 deletions

.github/workflows/_static-analysis.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,3 @@ jobs:
3434
- name: Run lint
3535
run: |
3636
composer lint
37-
38-
- name: Run PHPStan
39-
run: |
40-
composer phpstan
41-
42-
- name: Run Rector
43-
run: |
44-
composer rector:check
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* Configuration Class for CLI.
3535
*/
36-
class MindeeCLICommand extends Command
36+
class MindeeCliCommand extends Command
3737
{
3838
/**
3939
* @var array $documentList Array of document configurations.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/**
3535
* Document specifications for CLI usage.
3636
*/
37-
class MindeeCLIDocuments
37+
class MindeeCliDocuments
3838
{
3939
/**
4040
* @return array Specifications for each Mindee Document, for CLI usage.

bin/cli.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
namespace Mindee\Cli;
66

77
require __DIR__ . '/../vendor/autoload.php';
8-
require __DIR__ . '/MindeeCLIDocuments.php';
9-
require __DIR__ . '/MindeeCLICommand.php';
8+
require __DIR__ . '/MindeeCliDocuments.php';
9+
require __DIR__ . '/MindeeCliCommand.php';
1010

1111
use Symfony\Component\Console\Application;
1212
use Exception;
1313

1414
$cli = new Application();
15-
$mindeeCommand = new MindeeCLICommand(MindeeCLIDocuments::getSpecs());
15+
$mindeeCommand = new MindeeCliCommand(MindeeCliDocuments::getSpecs());
1616
$cli->add($mindeeCommand);
1717
try {
1818
$cli->add($mindeeCommand);

composer.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"madewithlove/license-checker": "^v1.0",
2020
"phpstan/phpstan": "^2.1",
2121
"phpstan/phpstan-deprecation-rules": "^2.0",
22-
"rector/rector": "^2.4"
22+
"rector/rector": "^2.4",
23+
"projektgopher/whisky": "^0.7.4"
2324
},
2425
"suggest": {
2526
"ext-imagick": "Required for PDF rasterization and image processing features",
@@ -35,10 +36,23 @@
3536
"bin/cli.php"
3637
],
3738
"scripts": {
38-
"lint": "php-cs-fixer fix --dry-run --diff",
39-
"phpstan": "phpstan analyse src --level 6",
40-
"format": "php-cs-fixer fix",
41-
"rector": "rector process src tests",
42-
"rector:check": "rector process src tests --dry-run"
39+
"lint:cs-fixer": "php-cs-fixer fix --dry-run --diff",
40+
"lint:rector": "rector process src tests --dry-run",
41+
"lint:phpstan": "phpstan analyse",
42+
"lint": [
43+
"@lint:phpstan",
44+
"@lint:cs-fixer",
45+
"@lint:rector"
46+
],
47+
"format:cs-fixer": "php-cs-fixer fix",
48+
"format:rector": "rector process src tests",
49+
"format": [
50+
"@format:cs-fixer",
51+
"@format:rector"
52+
],
53+
"test:unit": "phpunit -c tests/phpunit.xml",
54+
"test:functional": "phpunit -c tests/functional.xml",
55+
"test:smoke:v1": "./tests/test_v1_code_samples.sh",
56+
"test:smoke:v2": "./tests/test_v2_code_samples.sh"
4357
}
4458
}

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 6
3+
paths:
4+
- src

src/V1/Http/BaseApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Default URL prefix for API calls.
2323
*/
24-
const BASE_URL_DEFAULT = 'https://api.mindee.net/v1';
24+
const BASE_URL_DEFAULT = 'https://api.mindee.net';
2525

2626
/**
2727
* Default key name for CURL request timeout in environment variables.

src/V1/Http/BaseEndpoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function setFinalCurlOpts(
6464
?string $workflowId = null
6565
): array {
6666
if (isset($workflowId)) {
67-
$url = $this->settings->baseUrl . "/workflows/" . $workflowId . $suffix;
67+
$url = $this->settings->baseUrl . "/v1/workflows/" . $workflowId . $suffix;
6868
} else {
6969
$url = $this->settings->urlRoot . $suffix;
7070
}

src/V1/Http/MindeeApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ public function __construct(
5858
$this->urlRoot = rtrim(
5959
$this->baseUrl,
6060
"/"
61-
) . "/products/$this->accountName/$this->endpointName/v$this->version";
61+
) . "/v1/products/$this->accountName/$this->endpointName/v$this->version";
6262
}
6363
}

src/V1/Http/MindeeWorkflowApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function __construct(
3636
$this->urlRoot = rtrim(
3737
$this->baseUrl,
3838
"/"
39-
) . "/workflows/$this->workflowId/executions";
39+
) . "/v1/workflows/$this->workflowId/executions";
4040
}
4141
}

0 commit comments

Comments
 (0)