Skip to content

Commit 2e4a89f

Browse files
Merge pull request #5 from CASParser/release-please--branches--main--changes--next
release: 0.3.0
2 parents a7a0afe + 0c6c46b commit 2e4a89f

File tree

222 files changed

+20457
-4394
lines changed

Some content is hidden

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

222 files changed

+20457
-4394
lines changed

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.php diff=php
2+
3+
/.github export-ignore
4+
/bin export-ignore
5+
/scripts export-ignore
6+
/tests export-ignore
7+
8+
/.gitattributes export-ignore
9+
/.gitignore export-ignore
10+
/.php-cs-fixer.dist.php export-ignore
11+
/.phpactor.json export-ignore
12+
/.release-please-manifest.json export-ignore
13+
/.stats.yml export-ignore
14+
/phpstan.dist.neon export-ignore
15+
/phpunit.xml.dist export-ignore
16+
/release-please-config.json export-ignore

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v6
2424

2525
- name: Set up PHP
2626
uses: 'shivammathur/setup-php@v2'
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ${{ github.repository == 'stainless-sdks/cas-parser-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
3939
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
4040
steps:
41-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@v6
4242

4343
- name: Set up PHP
4444
uses: 'shivammathur/setup-php@v2'

.github/workflows/release-doctor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ jobs:
1212
if: github.repository == 'CASParser/cas-parser-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1313

1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616

1717
- name: Check release environment
1818
run: |
1919
bash ./bin/check-release-environment
20+
env:
21+
PACKAGIST_USERNAME: ${{ secrets.CAS_PARSER_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }}
22+
PACKAGIST_SAFE_KEY: ${{ secrets.CAS_PARSER_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
composer.lock
21
docs/
32
.idea/
43
.php-cs-fixer.cache
@@ -9,3 +8,6 @@ playground/
98
*.swo
109
*.swp
1110
vendor/
11+
12+
# do not edit! excludes generated files used internally
13+
.artifacts/

.php-cs-fixer.dist.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
use PhpCsFixer\Finder;
55
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
66

7-
return (new Config())
7+
ini_set('memory_limit', -1);
8+
9+
return (new Config)
810
->setParallelConfig(ParallelConfigFactory::detect())
911
->setFinder(Finder::create()->in([__DIR__.'/src', __DIR__.'/tests']))
1012
->setRules([

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.0"
2+
".": "0.3.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 5
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-b7fdba3d3f97c7debc22c7ca30b828bce81bcd64648df8c94029b27a3321ebb9.yml
3-
openapi_spec_hash: 03f1315f1d32ada42445ca920f047dff
4-
config_hash: cb5d75abef6264b5d86448caf7295afa
1+
configured_endpoints: 17
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml
3+
openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f
4+
config_hash: 1af2e938c93ea4ec25fc633469072c43

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Changelog
22

3+
## 0.3.0 (2026-02-14)
4+
5+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/CASParser/cas-parser-php/compare/v0.2.0...v0.3.0)
6+
7+
### ⚠ BREAKING CHANGES
8+
9+
* **client:** redesign methods
10+
* remove confusing `toArray()` alias to `__serialize()` in favour of `toProperties()`
11+
12+
### Features
13+
14+
* **api:** api update ([bbcfa14](https://github.com/CASParser/cas-parser-php/commit/bbcfa141a593d0d34c361c8ff2192dbd9e1ff0e3))
15+
* **api:** api update ([7bb648b](https://github.com/CASParser/cas-parser-php/commit/7bb648b9b9d87fa14c75e16628fe6d01e99f1198))
16+
* **api:** api update ([43a24ef](https://github.com/CASParser/cas-parser-php/commit/43a24ef1b13a87d203170dcc187c90045472cdea))
17+
* **api:** api update ([a45d08d](https://github.com/CASParser/cas-parser-php/commit/a45d08d64d5a4ad700f31d9180d5f79ce5ef06f2))
18+
* **api:** api update ([90a131a](https://github.com/CASParser/cas-parser-php/commit/90a131ad218e94a908056b01fb8425ab8783bbd4))
19+
* **api:** api update ([da8b838](https://github.com/CASParser/cas-parser-php/commit/da8b83821dab28680f72e98a943af25df296e314))
20+
* **api:** manual updates ([ef87761](https://github.com/CASParser/cas-parser-php/commit/ef877615b3b873e5f2cf3a3dfeb37f50dbaf71d5))
21+
* **client:** redesign methods ([5bc4f8f](https://github.com/CASParser/cas-parser-php/commit/5bc4f8fbca8bd998535963059460dcc2285c479e))
22+
* remove confusing `toArray()` alias to `__serialize()` in favour of `toProperties()` ([84053c4](https://github.com/CASParser/cas-parser-php/commit/84053c4b32db33f341e5e9bf89f2aabe982a2695))
23+
24+
25+
### Bug Fixes
26+
27+
* **ci:** release doctor workflow ([d7d0f00](https://github.com/CASParser/cas-parser-php/commit/d7d0f005e9022cce83d3316626e5746a3a02b694))
28+
* ensure auth methods return non-nullable arrays ([fd0ab3b](https://github.com/CASParser/cas-parser-php/commit/fd0ab3bb4232369f31350fb47d0aca4d916f5739))
29+
* inverted retry condition ([0112a9a](https://github.com/CASParser/cas-parser-php/commit/0112a9a50be77cb4681413034b3d88d791774f6c))
30+
* rename invalid types ([6b7a996](https://github.com/CASParser/cas-parser-php/commit/6b7a99682bfce707850bfddeb41d2474f109ba83))
31+
32+
33+
### Chores
34+
35+
* add license ([7742369](https://github.com/CASParser/cas-parser-php/commit/7742369f0a91046a7aa843391627e8931c6280f8))
36+
* **client:** send metadata headers ([9a72241](https://github.com/CASParser/cas-parser-php/commit/9a72241ae57939ae08709709a26a87f1ad83d9e2))
37+
* **docs:** update readme formatting ([f992e92](https://github.com/CASParser/cas-parser-php/commit/f992e921cd7043ea562ad58fb01905bd2039fa50))
38+
* **internal:** codegen related update ([c124b7b](https://github.com/CASParser/cas-parser-php/commit/c124b7bdd9b7d6f7bbef3d386f9eb4038a6b20f3))
39+
* refactor methods ([e25fa02](https://github.com/CASParser/cas-parser-php/commit/e25fa02ca0d7d49d88f1859c99e2db925a74e722))
40+
* update SDK settings ([66215fb](https://github.com/CASParser/cas-parser-php/commit/66215fb06d105b7678b59b7de76f68181d0c24fa))
41+
* use pascal case for phpstan typedefs ([574d168](https://github.com/CASParser/cas-parser-php/commit/574d1680fbbaccfc4281a98e33d205f4d8a7e043))
42+
343
## 0.2.0 (2025-09-13)
444

545
Full Changelog: [v0.1.0...v0.2.0](https://github.com/CASParser/cas-parser-php/compare/v0.1.0...v0.2.0)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Cas Parser
189+
Copyright 2026 Cas Parser
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
# Cas Parser PHP API library
22

3-
> [!NOTE]
4-
> The Cas Parser PHP API Library is currently in **beta** and we're excited for you to experiment with it!
5-
>
6-
> This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code.
7-
>
8-
> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/CASParser/cas-parser-php/issues/new).
9-
103
The Cas Parser PHP library provides convenient access to the Cas Parser REST API from any PHP 8.1.0+ application.
114

125
It is generated with [Stainless](https://www.stainless.com/).
136

147
## Documentation
158

16-
The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in/reference).
17-
189
## Installation
1910

2011
To use this package, install via Composer by adding the following to your application's `composer.json`:
@@ -47,11 +38,14 @@ Parameters with a default value must be set by name.
4738

4839
use CasParser\Client;
4940

50-
$client = new Client(apiKey: getenv("CAS_PARSER_API_KEY") ?: "My API Key");
41+
$client = new Client(
42+
apiKey: getenv('CAS_PARSER_API_KEY') ?: 'My API Key',
43+
environment: 'environment_1',
44+
);
5145

52-
$unifiedResponse = $client->casParser->smartParse();
46+
$response = $client->credits->check();
5347

54-
var_dump($unifiedResponse->demat_accounts);
48+
var_dump($response->enabled_features);
5549
```
5650

5751
### Value Objects
@@ -69,15 +63,17 @@ When the library is unable to connect to the API, or if the API returns a non-su
6963
<?php
7064

7165
use CasParser\Core\Exceptions\APIConnectionException;
66+
use CasParser\Core\Exceptions\RateLimitException;
67+
use CasParser\Core\Exceptions\APIStatusException;
7268

7369
try {
74-
$unifiedResponse = $client->casParser->smartParse();
70+
$response = $client->credits->check();
7571
} catch (APIConnectionException $e) {
7672
echo "The server could not be reached", PHP_EOL;
7773
var_dump($e->getPrevious());
78-
} catch (RateLimitError $_) {
74+
} catch (RateLimitException $e) {
7975
echo "A 429 status code was received; we should back off a bit.", PHP_EOL;
80-
} catch (APIStatusError $e) {
76+
} catch (APIStatusException $e) {
8177
echo "Another non-200-range status code was received", PHP_EOL;
8278
echo $e->getMessage();
8379
}
@@ -111,16 +107,12 @@ You can use the `maxRetries` option to configure or disable this:
111107
<?php
112108

113109
use CasParser\Client;
114-
use CasParser\RequestOptions;
115110

116111
// Configure the default for all requests:
117-
$client = new Client(maxRetries: 0);
112+
$client = new Client(requestOptions: ['maxRetries' => 0]);
118113

119114
// Or, configure per-request:
120-
121-
$result = $client->casParser->smartParse(
122-
requestOptions: RequestOptions::with(maxRetries: 5)
123-
);
115+
$result = $client->credits->check(requestOptions: ['maxRetries' => 5]);
124116
```
125117

126118
## Advanced concepts
@@ -136,17 +128,13 @@ Note: the `extra*` parameters of the same name overrides the documented paramete
136128
```php
137129
<?php
138130

139-
use CasParser\RequestOptions;
140-
141-
$unifiedResponse = $client->casParser->smartParse(
142-
requestOptions: RequestOptions::with(
143-
extraQueryParams: ["my_query_parameter" => "value"],
144-
extraBodyParams: ["my_body_parameter" => "value"],
145-
extraHeaders: ["my-header" => "value"],
146-
),
131+
$response = $client->credits->check(
132+
requestOptions: [
133+
'extraQueryParams' => ['my_query_parameter' => 'value'],
134+
'extraBodyParams' => ['my_body_parameter' => 'value'],
135+
'extraHeaders' => ['my-header' => 'value'],
136+
],
147137
);
148-
149-
var_dump($unifiedResponse["my_undocumented_property"]);
150138
```
151139

152140
#### Undocumented request params

0 commit comments

Comments
 (0)