From 8e520a0452175fc10becdd28fc9bf5b37cecf434 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 02:45:51 +0000 Subject: [PATCH 1/9] chore: document parameter object usage --- src/CasGenerator/CasGeneratorGenerateCasParams.php | 11 +++++++++++ src/CasParser/CasParserCamsKfintechParams.php | 11 +++++++++++ src/CasParser/CasParserCdslParams.php | 11 +++++++++++ src/CasParser/CasParserNsdlParams.php | 11 +++++++++++ src/CasParser/CasParserSmartParseParams.php | 11 +++++++++++ 5 files changed, 55 insertions(+) diff --git a/src/CasGenerator/CasGeneratorGenerateCasParams.php b/src/CasGenerator/CasGeneratorGenerateCasParams.php index f8f5c20..089363f 100644 --- a/src/CasGenerator/CasGeneratorGenerateCasParams.php +++ b/src/CasGenerator/CasGeneratorGenerateCasParams.php @@ -11,9 +11,20 @@ use CasParser\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CasGeneratorGenerateCasParams); // set properties as needed + * $client->casGenerator->generateCas(...$params->toArray()); + * ``` * This endpoint generates CAS (Consolidated Account Statement) documents by submitting a mailback request to the specified CAS authority. * Currently only supports KFintech, with plans to support CAMS, CDSL, and NSDL in the future. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->casGenerator->generateCas(...$params->toArray());` + * * @see CasParser\CasGenerator->generateCas * * @phpstan-type cas_generator_generate_cas_params = array{ diff --git a/src/CasParser/CasParserCamsKfintechParams.php b/src/CasParser/CasParserCamsKfintechParams.php index 0dda13d..8e09e3b 100644 --- a/src/CasParser/CasParserCamsKfintechParams.php +++ b/src/CasParser/CasParserCamsKfintechParams.php @@ -10,9 +10,20 @@ use CasParser\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CasParserCamsKfintechParams); // set properties as needed + * $client->casParser->camsKfintech(...$params->toArray()); + * ``` * This endpoint specifically parses CAMS/KFintech CAS (Consolidated Account Statement) PDF files and returns data in a unified format. * Use this endpoint when you know the PDF is from CAMS or KFintech. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->casParser->camsKfintech(...$params->toArray());` + * * @see CasParser\CasParser->camsKfintech * * @phpstan-type cas_parser_cams_kfintech_params = array{ diff --git a/src/CasParser/CasParserCdslParams.php b/src/CasParser/CasParserCdslParams.php index c8401d7..d48b9b2 100644 --- a/src/CasParser/CasParserCdslParams.php +++ b/src/CasParser/CasParserCdslParams.php @@ -10,9 +10,20 @@ use CasParser\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CasParserCdslParams); // set properties as needed + * $client->casParser->cdsl(...$params->toArray()); + * ``` * This endpoint specifically parses CDSL CAS (Consolidated Account Statement) PDF files and returns data in a unified format. * Use this endpoint when you know the PDF is from CDSL. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->casParser->cdsl(...$params->toArray());` + * * @see CasParser\CasParser->cdsl * * @phpstan-type cas_parser_cdsl_params = array{ diff --git a/src/CasParser/CasParserNsdlParams.php b/src/CasParser/CasParserNsdlParams.php index df6c11a..98320b2 100644 --- a/src/CasParser/CasParserNsdlParams.php +++ b/src/CasParser/CasParserNsdlParams.php @@ -10,9 +10,20 @@ use CasParser\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CasParserNsdlParams); // set properties as needed + * $client->casParser->nsdl(...$params->toArray()); + * ``` * This endpoint specifically parses NSDL CAS (Consolidated Account Statement) PDF files and returns data in a unified format. * Use this endpoint when you know the PDF is from NSDL. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->casParser->nsdl(...$params->toArray());` + * * @see CasParser\CasParser->nsdl * * @phpstan-type cas_parser_nsdl_params = array{ diff --git a/src/CasParser/CasParserSmartParseParams.php b/src/CasParser/CasParserSmartParseParams.php index 5596cf1..525ebf1 100644 --- a/src/CasParser/CasParserSmartParseParams.php +++ b/src/CasParser/CasParserSmartParseParams.php @@ -10,9 +10,20 @@ use CasParser\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CasParserSmartParseParams); // set properties as needed + * $client->casParser->smartParse(...$params->toArray()); + * ``` * This endpoint parses CAS (Consolidated Account Statement) PDF files from NSDL, CDSL, or CAMS/KFintech and returns data in a unified format. * It auto-detects the CAS type and transforms the data into a consistent structure regardless of the source. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->casParser->smartParse(...$params->toArray());` + * * @see CasParser\CasParser->smartParse * * @phpstan-type cas_parser_smart_parse_params = array{ From d8d2163afa66e726f571c31276eaca485c4dda84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 03:07:30 +0000 Subject: [PATCH 2/9] chore: cleanup streaming --- src/Core/Util.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Core/Util.php b/src/Core/Util.php index 68721b8..8ff5dd1 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -10,6 +10,11 @@ use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; +/** + * @phpstan-type SSEvent = array{ + * event?: string|null, data?: string|null, id?: string|null, retry?: int|null + * } + */ final class Util { public const BUF_SIZE = 8192; @@ -239,11 +244,7 @@ public static function decodeLines(\Iterator $stream): \Iterator /** * @param \Iterator $lines * - * @return \Generator< - * array{ - * event?: string|null, data?: string|null, id?: string|null, retry?: int|null - * }, - * > + * @return \Generator */ public static function decodeSSE(\Iterator $lines): \Generator { From 35208e4d7fced2de5826111980cfd51bebd1ad74 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 03:08:27 +0000 Subject: [PATCH 3/9] chore: make more targeted phpstan ignores --- tests/Services/CasGeneratorTest.php | 4 ++-- tests/Services/CasParserTest.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Services/CasGeneratorTest.php b/tests/Services/CasGeneratorTest.php index 12120b4..ac566d8 100644 --- a/tests/Services/CasGeneratorTest.php +++ b/tests/Services/CasGeneratorTest.php @@ -40,7 +40,7 @@ public function testGenerateCas(): void toDate: '2023-12-31', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -57,6 +57,6 @@ public function testGenerateCasWithOptionalParams(): void toDate: '2023-12-31', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/CasParserTest.php b/tests/Services/CasParserTest.php index a6cd2a3..17f3bb6 100644 --- a/tests/Services/CasParserTest.php +++ b/tests/Services/CasParserTest.php @@ -35,7 +35,7 @@ public function testCamsKfintech(): void $result = $this->client->casParser->camsKfintech(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -47,7 +47,7 @@ public function testCdsl(): void $result = $this->client->casParser->cdsl(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -59,7 +59,7 @@ public function testNsdl(): void $result = $this->client->casParser->nsdl(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -71,6 +71,6 @@ public function testSmartParse(): void $result = $this->client->casParser->smartParse(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } From 36e3c1d53c72f8b86e8ccf565fd3399bb3847834 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 03:11:22 +0000 Subject: [PATCH 4/9] feat!: expose services and service contracts --- src/Client.php | 4 ++-- src/{Core => }/ServiceContracts/CasGeneratorContract.php | 2 +- src/{Core => }/ServiceContracts/CasParserContract.php | 2 +- src/{Core => }/Services/CasGeneratorService.php | 4 ++-- src/{Core => }/Services/CasParserService.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) rename src/{Core => }/ServiceContracts/CasGeneratorContract.php (96%) rename src/{Core => }/ServiceContracts/CasParserContract.php (97%) rename src/{Core => }/Services/CasGeneratorService.php (95%) rename src/{Core => }/Services/CasParserService.php (98%) diff --git a/src/Client.php b/src/Client.php index 2f39108..947f3cc 100644 --- a/src/Client.php +++ b/src/Client.php @@ -5,8 +5,8 @@ namespace CasParser; use CasParser\Core\BaseClient; -use CasParser\Core\Services\CasGeneratorService; -use CasParser\Core\Services\CasParserService; +use CasParser\Services\CasGeneratorService; +use CasParser\Services\CasParserService; use Http\Discovery\Psr17FactoryDiscovery; use Http\Discovery\Psr18ClientDiscovery; diff --git a/src/Core/ServiceContracts/CasGeneratorContract.php b/src/ServiceContracts/CasGeneratorContract.php similarity index 96% rename from src/Core/ServiceContracts/CasGeneratorContract.php rename to src/ServiceContracts/CasGeneratorContract.php index 5d2cab4..f43758d 100644 --- a/src/Core/ServiceContracts/CasGeneratorContract.php +++ b/src/ServiceContracts/CasGeneratorContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace CasParser\Core\ServiceContracts; +namespace CasParser\ServiceContracts; use CasParser\CasGenerator\CasGeneratorGenerateCasParams\CasAuthority; use CasParser\CasGenerator\CasGeneratorGenerateCasResponse; diff --git a/src/Core/ServiceContracts/CasParserContract.php b/src/ServiceContracts/CasParserContract.php similarity index 97% rename from src/Core/ServiceContracts/CasParserContract.php rename to src/ServiceContracts/CasParserContract.php index ac15e0a..1d1a4f2 100644 --- a/src/Core/ServiceContracts/CasParserContract.php +++ b/src/ServiceContracts/CasParserContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace CasParser\Core\ServiceContracts; +namespace CasParser\ServiceContracts; use CasParser\CasParser\UnifiedResponse; use CasParser\RequestOptions; diff --git a/src/Core/Services/CasGeneratorService.php b/src/Services/CasGeneratorService.php similarity index 95% rename from src/Core/Services/CasGeneratorService.php rename to src/Services/CasGeneratorService.php index 1fb4a94..0013859 100644 --- a/src/Core/Services/CasGeneratorService.php +++ b/src/Services/CasGeneratorService.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace CasParser\Core\Services; +namespace CasParser\Services; use CasParser\CasGenerator\CasGeneratorGenerateCasParams; use CasParser\CasGenerator\CasGeneratorGenerateCasParams\CasAuthority; use CasParser\CasGenerator\CasGeneratorGenerateCasResponse; use CasParser\Client; -use CasParser\Core\ServiceContracts\CasGeneratorContract; use CasParser\RequestOptions; +use CasParser\ServiceContracts\CasGeneratorContract; use const CasParser\Core\OMIT as omit; diff --git a/src/Core/Services/CasParserService.php b/src/Services/CasParserService.php similarity index 98% rename from src/Core/Services/CasParserService.php rename to src/Services/CasParserService.php index 27fbe5a..883ee5f 100644 --- a/src/Core/Services/CasParserService.php +++ b/src/Services/CasParserService.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace CasParser\Core\Services; +namespace CasParser\Services; use CasParser\CasParser\CasParserCamsKfintechParams; use CasParser\CasParser\CasParserCdslParams; @@ -10,8 +10,8 @@ use CasParser\CasParser\CasParserSmartParseParams; use CasParser\CasParser\UnifiedResponse; use CasParser\Client; -use CasParser\Core\ServiceContracts\CasParserContract; use CasParser\RequestOptions; +use CasParser\ServiceContracts\CasParserContract; use const CasParser\Core\OMIT as omit; From 9b7428ffe0e2a19b1b7ad6c87e90ee14eddce749 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 02:37:56 +0000 Subject: [PATCH 5/9] feat(client): use real enums --- .../CasGeneratorGenerateCasParams.php | 16 ++++----- .../CasAuthority.php | 15 +++----- .../UnifiedResponse/DematAccount.php | 16 ++++----- .../DematAccount/DematType.php | 11 ++---- src/CasParser/UnifiedResponse/Meta.php | 16 ++++----- .../UnifiedResponse/Meta/CasType.php | 13 +++---- .../UnifiedResponse/MutualFund/Scheme.php | 16 ++++----- .../MutualFund/Scheme/Type.php | 15 +++----- src/Core/Attributes/Api.php | 34 ++++++++++++++++--- src/ServiceContracts/CasGeneratorContract.php | 2 +- src/Services/CasGeneratorService.php | 2 +- 11 files changed, 80 insertions(+), 76 deletions(-) diff --git a/src/CasGenerator/CasGeneratorGenerateCasParams.php b/src/CasGenerator/CasGeneratorGenerateCasParams.php index 089363f..3f3de18 100644 --- a/src/CasGenerator/CasGeneratorGenerateCasParams.php +++ b/src/CasGenerator/CasGeneratorGenerateCasParams.php @@ -32,7 +32,7 @@ * fromDate: string, * password: string, * toDate: string, - * casAuthority?: CasAuthority::*, + * casAuthority?: CasAuthority|value-of, * panNo?: string, * } */ @@ -69,7 +69,7 @@ final class CasGeneratorGenerateCasParams implements BaseModel /** * CAS authority to generate the document from (currently only kfintech is supported). * - * @var CasAuthority::*|null $casAuthority + * @var value-of|null $casAuthority */ #[Api('cas_authority', enum: CasAuthority::class, optional: true)] public ?string $casAuthority; @@ -110,14 +110,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param CasAuthority::* $casAuthority + * @param CasAuthority|value-of $casAuthority */ public static function with( string $email, string $fromDate, string $password, string $toDate, - ?string $casAuthority = null, + CasAuthority|string|null $casAuthority = null, ?string $panNo = null, ): self { $obj = new self; @@ -127,7 +127,7 @@ public static function with( $obj->password = $password; $obj->toDate = $toDate; - null !== $casAuthority && $obj->casAuthority = $casAuthority; + null !== $casAuthority && $obj->casAuthority = $casAuthority instanceof CasAuthority ? $casAuthority->value : $casAuthority; null !== $panNo && $obj->panNo = $panNo; return $obj; @@ -180,12 +180,12 @@ public function withToDate(string $toDate): self /** * CAS authority to generate the document from (currently only kfintech is supported). * - * @param CasAuthority::* $casAuthority + * @param CasAuthority|value-of $casAuthority */ - public function withCasAuthority(string $casAuthority): self + public function withCasAuthority(CasAuthority|string $casAuthority): self { $obj = clone $this; - $obj->casAuthority = $casAuthority; + $obj->casAuthority = $casAuthority instanceof CasAuthority ? $casAuthority->value : $casAuthority; return $obj; } diff --git a/src/CasGenerator/CasGeneratorGenerateCasParams/CasAuthority.php b/src/CasGenerator/CasGeneratorGenerateCasParams/CasAuthority.php index 8c5f709..8f84c5d 100644 --- a/src/CasGenerator/CasGeneratorGenerateCasParams/CasAuthority.php +++ b/src/CasGenerator/CasGeneratorGenerateCasParams/CasAuthority.php @@ -4,21 +4,16 @@ namespace CasParser\CasGenerator\CasGeneratorGenerateCasParams; -use CasParser\Core\Concerns\SdkEnum; -use CasParser\Core\Conversion\Contracts\ConverterSource; - /** * CAS authority to generate the document from (currently only kfintech is supported). */ -final class CasAuthority implements ConverterSource +enum CasAuthority: string { - use SdkEnum; - - public const KFINTECH = 'kfintech'; + case KFINTECH = 'kfintech'; - public const CAMS = 'cams'; + case CAMS = 'cams'; - public const CDSL = 'cdsl'; + case CDSL = 'cdsl'; - public const NSDL = 'nsdl'; + case NSDL = 'nsdl'; } diff --git a/src/CasParser/UnifiedResponse/DematAccount.php b/src/CasParser/UnifiedResponse/DematAccount.php index 1833505..b690b8c 100644 --- a/src/CasParser/UnifiedResponse/DematAccount.php +++ b/src/CasParser/UnifiedResponse/DematAccount.php @@ -16,7 +16,7 @@ * additionalInfo?: AdditionalInfo|null, * boID?: string|null, * clientID?: string|null, - * dematType?: DematType::*|null, + * dematType?: value-of|null, * dpID?: string|null, * dpName?: string|null, * holdings?: Holdings|null, @@ -49,7 +49,7 @@ final class DematAccount implements BaseModel /** * Type of demat account. * - * @var DematType::*|null $dematType + * @var value-of|null $dematType */ #[Api('demat_type', enum: DematType::class, optional: true)] public ?string $dematType; @@ -85,13 +85,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DematType::* $dematType + * @param DematType|value-of $dematType */ public static function with( ?AdditionalInfo $additionalInfo = null, ?string $boID = null, ?string $clientID = null, - ?string $dematType = null, + DematType|string|null $dematType = null, ?string $dpID = null, ?string $dpName = null, ?Holdings $holdings = null, @@ -102,7 +102,7 @@ public static function with( null !== $additionalInfo && $obj->additionalInfo = $additionalInfo; null !== $boID && $obj->boID = $boID; null !== $clientID && $obj->clientID = $clientID; - null !== $dematType && $obj->dematType = $dematType; + null !== $dematType && $obj->dematType = $dematType instanceof DematType ? $dematType->value : $dematType; null !== $dpID && $obj->dpID = $dpID; null !== $dpName && $obj->dpName = $dpName; null !== $holdings && $obj->holdings = $holdings; @@ -147,12 +147,12 @@ public function withClientID(string $clientID): self /** * Type of demat account. * - * @param DematType::* $dematType + * @param DematType|value-of $dematType */ - public function withDematType(string $dematType): self + public function withDematType(DematType|string $dematType): self { $obj = clone $this; - $obj->dematType = $dematType; + $obj->dematType = $dematType instanceof DematType ? $dematType->value : $dematType; return $obj; } diff --git a/src/CasParser/UnifiedResponse/DematAccount/DematType.php b/src/CasParser/UnifiedResponse/DematAccount/DematType.php index 0cc1284..53bf589 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/DematType.php +++ b/src/CasParser/UnifiedResponse/DematAccount/DematType.php @@ -4,17 +4,12 @@ namespace CasParser\CasParser\UnifiedResponse\DematAccount; -use CasParser\Core\Concerns\SdkEnum; -use CasParser\Core\Conversion\Contracts\ConverterSource; - /** * Type of demat account. */ -final class DematType implements ConverterSource +enum DematType: string { - use SdkEnum; - - public const NSDL = 'NSDL'; + case NSDL = 'NSDL'; - public const CDSL = 'CDSL'; + case CDSL = 'CDSL'; } diff --git a/src/CasParser/UnifiedResponse/Meta.php b/src/CasParser/UnifiedResponse/Meta.php index 1187ef3..a77acff 100644 --- a/src/CasParser/UnifiedResponse/Meta.php +++ b/src/CasParser/UnifiedResponse/Meta.php @@ -12,7 +12,7 @@ /** * @phpstan-type meta_alias = array{ - * casType?: CasType::*|null, + * casType?: value-of|null, * generatedAt?: \DateTimeInterface|null, * statementPeriod?: StatementPeriod|null, * } @@ -25,7 +25,7 @@ final class Meta implements BaseModel /** * Type of CAS detected and processed. * - * @var CasType::*|null $casType + * @var value-of|null $casType */ #[Api('cas_type', enum: CasType::class, optional: true)] public ?string $casType; @@ -49,16 +49,16 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param CasType::* $casType + * @param CasType|value-of $casType */ public static function with( - ?string $casType = null, + CasType|string|null $casType = null, ?\DateTimeInterface $generatedAt = null, ?StatementPeriod $statementPeriod = null, ): self { $obj = new self; - null !== $casType && $obj->casType = $casType; + null !== $casType && $obj->casType = $casType instanceof CasType ? $casType->value : $casType; null !== $generatedAt && $obj->generatedAt = $generatedAt; null !== $statementPeriod && $obj->statementPeriod = $statementPeriod; @@ -68,12 +68,12 @@ public static function with( /** * Type of CAS detected and processed. * - * @param CasType::* $casType + * @param CasType|value-of $casType */ - public function withCasType(string $casType): self + public function withCasType(CasType|string $casType): self { $obj = clone $this; - $obj->casType = $casType; + $obj->casType = $casType instanceof CasType ? $casType->value : $casType; return $obj; } diff --git a/src/CasParser/UnifiedResponse/Meta/CasType.php b/src/CasParser/UnifiedResponse/Meta/CasType.php index 6fc6c8e..bed4fed 100644 --- a/src/CasParser/UnifiedResponse/Meta/CasType.php +++ b/src/CasParser/UnifiedResponse/Meta/CasType.php @@ -4,19 +4,14 @@ namespace CasParser\CasParser\UnifiedResponse\Meta; -use CasParser\Core\Concerns\SdkEnum; -use CasParser\Core\Conversion\Contracts\ConverterSource; - /** * Type of CAS detected and processed. */ -final class CasType implements ConverterSource +enum CasType: string { - use SdkEnum; - - public const NSDL = 'NSDL'; + case NSDL = 'NSDL'; - public const CDSL = 'CDSL'; + case CDSL = 'CDSL'; - public const CAMS_KFINTECH = 'CAMS_KFINTECH'; + case CAMS_KFINTECH = 'CAMS_KFINTECH'; } diff --git a/src/CasParser/UnifiedResponse/MutualFund/Scheme.php b/src/CasParser/UnifiedResponse/MutualFund/Scheme.php index 4923d8c..f5f45e7 100644 --- a/src/CasParser/UnifiedResponse/MutualFund/Scheme.php +++ b/src/CasParser/UnifiedResponse/MutualFund/Scheme.php @@ -22,7 +22,7 @@ * nav?: float|null, * nominees?: list|null, * transactions?: list|null, - * type?: Type::*|null, + * type?: value-of|null, * units?: float|null, * value?: float|null, * } @@ -80,7 +80,7 @@ final class Scheme implements BaseModel /** * Type of mutual fund scheme. * - * @var Type::*|null $type + * @var value-of|null $type */ #[Api(enum: Type::class, optional: true)] public ?string $type; @@ -109,7 +109,7 @@ public function __construct() * * @param list $nominees * @param list $transactions - * @param Type::* $type + * @param Type|value-of $type */ public static function with( ?AdditionalInfo $additionalInfo = null, @@ -120,7 +120,7 @@ public static function with( ?float $nav = null, ?array $nominees = null, ?array $transactions = null, - ?string $type = null, + Type|string|null $type = null, ?float $units = null, ?float $value = null, ): self { @@ -134,7 +134,7 @@ public static function with( null !== $nav && $obj->nav = $nav; null !== $nominees && $obj->nominees = $nominees; null !== $transactions && $obj->transactions = $transactions; - null !== $type && $obj->type = $type; + null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; null !== $units && $obj->units = $units; null !== $value && $obj->value = $value; @@ -231,12 +231,12 @@ public function withTransactions(array $transactions): self /** * Type of mutual fund scheme. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/CasParser/UnifiedResponse/MutualFund/Scheme/Type.php b/src/CasParser/UnifiedResponse/MutualFund/Scheme/Type.php index ad08d86..76f8faf 100644 --- a/src/CasParser/UnifiedResponse/MutualFund/Scheme/Type.php +++ b/src/CasParser/UnifiedResponse/MutualFund/Scheme/Type.php @@ -4,21 +4,16 @@ namespace CasParser\CasParser\UnifiedResponse\MutualFund\Scheme; -use CasParser\Core\Concerns\SdkEnum; -use CasParser\Core\Conversion\Contracts\ConverterSource; - /** * Type of mutual fund scheme. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const EQUITY = 'Equity'; + case EQUITY = 'Equity'; - public const DEBT = 'Debt'; + case DEBT = 'Debt'; - public const HYBRID = 'Hybrid'; + case HYBRID = 'Hybrid'; - public const OTHER = 'Other'; + case OTHER = 'Other'; } diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php index fd2b006..c3f6875 100644 --- a/src/Core/Attributes/Api.php +++ b/src/Core/Attributes/Api.php @@ -6,6 +6,7 @@ use CasParser\Core\Conversion\Contracts\Converter; use CasParser\Core\Conversion\Contracts\ConverterSource; +use CasParser\Core\Conversion\EnumOf; use CasParser\Core\Conversion\ListOf; use CasParser\Core\Conversion\MapOf; @@ -15,14 +16,15 @@ #[\Attribute(\Attribute::TARGET_PROPERTY)] final class Api { - /** - * @var class-string|Converter|string|null - */ + /** @var class-string|Converter|string|null */ public readonly Converter|string|null $type; + /** @var array */ + private static array $enumConverters = []; + /** * @param class-string|Converter|string|null $type - * @param class-string|Converter|null $enum + * @param class-string<\BackedEnum>|Converter|null $enum * @param class-string|Converter|null $union * @param class-string|Converter|string|null $list * @param class-string|Converter|string|null $map @@ -37,6 +39,28 @@ public function __construct( public readonly bool $nullable = false, public readonly bool $optional = false, ) { - $this->type = $type ?? $enum ?? $union ?? ($list ? new ListOf($list) : ($map ? new MapOf($map) : null)); + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; } } diff --git a/src/ServiceContracts/CasGeneratorContract.php b/src/ServiceContracts/CasGeneratorContract.php index f43758d..aa66b8c 100644 --- a/src/ServiceContracts/CasGeneratorContract.php +++ b/src/ServiceContracts/CasGeneratorContract.php @@ -19,7 +19,7 @@ interface CasGeneratorContract * @param string $fromDate Start date for the CAS period (format YYYY-MM-DD) * @param string $password Password to protect the generated CAS PDF * @param string $toDate End date for the CAS period (format YYYY-MM-DD) - * @param CasAuthority::* $casAuthority CAS authority to generate the document from (currently only kfintech is supported) + * @param CasAuthority|value-of $casAuthority CAS authority to generate the document from (currently only kfintech is supported) * @param string $panNo PAN number (optional for some CAS authorities) */ public function generateCas( diff --git a/src/Services/CasGeneratorService.php b/src/Services/CasGeneratorService.php index 0013859..38f80d7 100644 --- a/src/Services/CasGeneratorService.php +++ b/src/Services/CasGeneratorService.php @@ -30,7 +30,7 @@ public function __construct(private Client $client) {} * @param string $fromDate Start date for the CAS period (format YYYY-MM-DD) * @param string $password Password to protect the generated CAS PDF * @param string $toDate End date for the CAS period (format YYYY-MM-DD) - * @param CasAuthority::* $casAuthority CAS authority to generate the document from (currently only kfintech is supported) + * @param CasAuthority|value-of $casAuthority CAS authority to generate the document from (currently only kfintech is supported) * @param string $panNo PAN number (optional for some CAS authorities) */ public function generateCas( From 4fcc712c36036429b1f410f3c3ae88f3a8ad3147 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 02:40:50 +0000 Subject: [PATCH 6/9] chore: fix lints in UnionOf --- src/Core/Conversion/UnionOf.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Core/Conversion/UnionOf.php b/src/Core/Conversion/UnionOf.php index 4a059ab..0145ca1 100644 --- a/src/Core/Conversion/UnionOf.php +++ b/src/Core/Conversion/UnionOf.php @@ -65,7 +65,7 @@ public function coerce(mixed $value, CoerceState $state): mixed public function dump(mixed $value, DumpState $state): mixed { - if (!is_null($target = $this->resolveVariant(value: $value))) { + if (null !== ($target = $this->resolveVariant(value: $value))) { return Conversion::dump($target, value: $value, state: $state); } @@ -85,8 +85,15 @@ private function resolveVariant( return $value::class; } - if (!is_null($this->discriminator) && is_array($value) && array_key_exists($this->discriminator, array: $value)) { + if ( + null !== $this->discriminator + && is_array($value) + && array_key_exists($this->discriminator, array: $value) + ) { $discriminator = $value[$this->discriminator]; + if (!is_string($discriminator)) { + return null; + } return $this->variants[$discriminator] ?? null; } From db0fac37cc5a9f56fb8f095f4c895f91a206bfa5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 13 Sep 2025 02:34:47 +0000 Subject: [PATCH 7/9] feat(client): support raw responses --- .../CasGeneratorGenerateCasResponse.php | 6 ++++- src/CasParser/UnifiedResponse.php | 16 +++++++++----- .../UnifiedResponse/DematAccount.php | 16 +++++++------- .../DematAccount/AdditionalInfo.php | 16 +++++++------- .../UnifiedResponse/DematAccount/Holdings.php | 10 ++++----- .../DematAccount/Holdings/Aif.php | 8 +++---- .../DematAccount/Holdings/CorporateBond.php | 8 +++---- .../DematAccount/Holdings/DematMutualFund.php | 8 +++---- .../DematAccount/Holdings/Equity.php | 8 +++---- .../Holdings/GovernmentSecurity.php | 8 +++---- src/CasParser/UnifiedResponse/Insurance.php | 2 +- .../Insurance/LifeInsurancePolicy.php | 16 +++++++------- src/CasParser/UnifiedResponse/Investor.php | 14 ++++++------ src/CasParser/UnifiedResponse/Meta.php | 6 ++--- .../UnifiedResponse/Meta/StatementPeriod.php | 2 +- src/CasParser/UnifiedResponse/MutualFund.php | 12 +++++----- .../MutualFund/AdditionalInfo.php | 2 +- .../UnifiedResponse/MutualFund/Scheme.php | 22 +++++++++---------- .../MutualFund/Scheme/AdditionalInfo.php | 10 ++++----- .../MutualFund/Scheme/Gain.php | 2 +- .../MutualFund/Scheme/Transaction.php | 16 +++++++------- src/CasParser/UnifiedResponse/Summary.php | 4 +--- .../UnifiedResponse/Summary/Accounts.php | 2 +- .../Summary/Accounts/Demat.php | 2 +- .../Summary/Accounts/Insurance.php | 2 +- .../Summary/Accounts/MutualFunds.php | 2 +- src/Core/Implementation/HasRawResponse.php | 10 +++++++++ src/ServiceContracts/CasGeneratorContract.php | 3 +++ src/ServiceContracts/CasParserContract.php | 9 ++++++++ src/Services/CasGeneratorService.php | 3 +++ src/Services/CasParserService.php | 9 ++++++++ 31 files changed, 147 insertions(+), 107 deletions(-) create mode 100644 src/Core/Implementation/HasRawResponse.php diff --git a/src/CasGenerator/CasGeneratorGenerateCasResponse.php b/src/CasGenerator/CasGeneratorGenerateCasResponse.php index 97e841e..b05b566 100644 --- a/src/CasGenerator/CasGeneratorGenerateCasResponse.php +++ b/src/CasGenerator/CasGeneratorGenerateCasResponse.php @@ -10,8 +10,12 @@ /** * @phpstan-type cas_generator_generate_cas_response = array{ - * msg?: string|null, status?: string|null + * msg?: string, status?: string * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class CasGeneratorGenerateCasResponse implements BaseModel { diff --git a/src/CasParser/UnifiedResponse.php b/src/CasParser/UnifiedResponse.php index 2e0c131..8553bdf 100644 --- a/src/CasParser/UnifiedResponse.php +++ b/src/CasParser/UnifiedResponse.php @@ -16,13 +16,17 @@ /** * @phpstan-type unified_response = array{ - * dematAccounts?: list|null, - * insurance?: Insurance|null, - * investor?: Investor|null, - * meta?: Meta|null, - * mutualFunds?: list|null, - * summary?: Summary|null, + * dematAccounts?: list, + * insurance?: Insurance, + * investor?: Investor, + * meta?: Meta, + * mutualFunds?: list, + * summary?: Summary, * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class UnifiedResponse implements BaseModel { diff --git a/src/CasParser/UnifiedResponse/DematAccount.php b/src/CasParser/UnifiedResponse/DematAccount.php index b690b8c..0c57e41 100644 --- a/src/CasParser/UnifiedResponse/DematAccount.php +++ b/src/CasParser/UnifiedResponse/DematAccount.php @@ -13,14 +13,14 @@ /** * @phpstan-type demat_account = array{ - * additionalInfo?: AdditionalInfo|null, - * boID?: string|null, - * clientID?: string|null, - * dematType?: value-of|null, - * dpID?: string|null, - * dpName?: string|null, - * holdings?: Holdings|null, - * value?: float|null, + * additionalInfo?: AdditionalInfo, + * boID?: string, + * clientID?: string, + * dematType?: value-of, + * dpID?: string, + * dpName?: string, + * holdings?: Holdings, + * value?: float, * } */ final class DematAccount implements BaseModel diff --git a/src/CasParser/UnifiedResponse/DematAccount/AdditionalInfo.php b/src/CasParser/UnifiedResponse/DematAccount/AdditionalInfo.php index 90b1ca7..c7a8be5 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/AdditionalInfo.php +++ b/src/CasParser/UnifiedResponse/DematAccount/AdditionalInfo.php @@ -12,14 +12,14 @@ * Additional information specific to the demat account type. * * @phpstan-type additional_info = array{ - * boStatus?: string|null, - * boSubStatus?: string|null, - * boType?: string|null, - * bsda?: string|null, - * email?: string|null, - * linkedPans?: list|null, - * nominee?: string|null, - * status?: string|null, + * boStatus?: string, + * boSubStatus?: string, + * boType?: string, + * bsda?: string, + * email?: string, + * linkedPans?: list, + * nominee?: string, + * status?: string, * } */ final class AdditionalInfo implements BaseModel diff --git a/src/CasParser/UnifiedResponse/DematAccount/Holdings.php b/src/CasParser/UnifiedResponse/DematAccount/Holdings.php index f942fef..eb3b0d1 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/Holdings.php +++ b/src/CasParser/UnifiedResponse/DematAccount/Holdings.php @@ -15,11 +15,11 @@ /** * @phpstan-type holdings_alias = array{ - * aifs?: list|null, - * corporateBonds?: list|null, - * dematMutualFunds?: list|null, - * equities?: list|null, - * governmentSecurities?: list|null, + * aifs?: list, + * corporateBonds?: list, + * dematMutualFunds?: list, + * equities?: list, + * governmentSecurities?: list, * } */ final class Holdings implements BaseModel diff --git a/src/CasParser/UnifiedResponse/DematAccount/Holdings/Aif.php b/src/CasParser/UnifiedResponse/DematAccount/Holdings/Aif.php index d893d44..1df6013 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/Holdings/Aif.php +++ b/src/CasParser/UnifiedResponse/DematAccount/Holdings/Aif.php @@ -11,10 +11,10 @@ /** * @phpstan-type aif_alias = array{ * additionalInfo?: mixed, - * isin?: string|null, - * name?: string|null, - * units?: float|null, - * value?: float|null, + * isin?: string, + * name?: string, + * units?: float, + * value?: float, * } */ final class Aif implements BaseModel diff --git a/src/CasParser/UnifiedResponse/DematAccount/Holdings/CorporateBond.php b/src/CasParser/UnifiedResponse/DematAccount/Holdings/CorporateBond.php index 2f86609..bfb4d84 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/Holdings/CorporateBond.php +++ b/src/CasParser/UnifiedResponse/DematAccount/Holdings/CorporateBond.php @@ -11,10 +11,10 @@ /** * @phpstan-type corporate_bond = array{ * additionalInfo?: mixed, - * isin?: string|null, - * name?: string|null, - * units?: float|null, - * value?: float|null, + * isin?: string, + * name?: string, + * units?: float, + * value?: float, * } */ final class CorporateBond implements BaseModel diff --git a/src/CasParser/UnifiedResponse/DematAccount/Holdings/DematMutualFund.php b/src/CasParser/UnifiedResponse/DematAccount/Holdings/DematMutualFund.php index 3d14ad3..36015d7 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/Holdings/DematMutualFund.php +++ b/src/CasParser/UnifiedResponse/DematAccount/Holdings/DematMutualFund.php @@ -11,10 +11,10 @@ /** * @phpstan-type demat_mutual_fund = array{ * additionalInfo?: mixed, - * isin?: string|null, - * name?: string|null, - * units?: float|null, - * value?: float|null, + * isin?: string, + * name?: string, + * units?: float, + * value?: float, * } */ final class DematMutualFund implements BaseModel diff --git a/src/CasParser/UnifiedResponse/DematAccount/Holdings/Equity.php b/src/CasParser/UnifiedResponse/DematAccount/Holdings/Equity.php index 771f7ec..0c1b5c2 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/Holdings/Equity.php +++ b/src/CasParser/UnifiedResponse/DematAccount/Holdings/Equity.php @@ -11,10 +11,10 @@ /** * @phpstan-type equity_alias = array{ * additionalInfo?: mixed, - * isin?: string|null, - * name?: string|null, - * units?: float|null, - * value?: float|null, + * isin?: string, + * name?: string, + * units?: float, + * value?: float, * } */ final class Equity implements BaseModel diff --git a/src/CasParser/UnifiedResponse/DematAccount/Holdings/GovernmentSecurity.php b/src/CasParser/UnifiedResponse/DematAccount/Holdings/GovernmentSecurity.php index 0755acd..cd4249f 100644 --- a/src/CasParser/UnifiedResponse/DematAccount/Holdings/GovernmentSecurity.php +++ b/src/CasParser/UnifiedResponse/DematAccount/Holdings/GovernmentSecurity.php @@ -11,10 +11,10 @@ /** * @phpstan-type government_security = array{ * additionalInfo?: mixed, - * isin?: string|null, - * name?: string|null, - * units?: float|null, - * value?: float|null, + * isin?: string, + * name?: string, + * units?: float, + * value?: float, * } */ final class GovernmentSecurity implements BaseModel diff --git a/src/CasParser/UnifiedResponse/Insurance.php b/src/CasParser/UnifiedResponse/Insurance.php index 49d0ef6..2a42859 100644 --- a/src/CasParser/UnifiedResponse/Insurance.php +++ b/src/CasParser/UnifiedResponse/Insurance.php @@ -11,7 +11,7 @@ /** * @phpstan-type insurance_alias = array{ - * lifeInsurancePolicies?: list|null + * lifeInsurancePolicies?: list * } */ final class Insurance implements BaseModel diff --git a/src/CasParser/UnifiedResponse/Insurance/LifeInsurancePolicy.php b/src/CasParser/UnifiedResponse/Insurance/LifeInsurancePolicy.php index 58eaa3d..c106c9c 100644 --- a/src/CasParser/UnifiedResponse/Insurance/LifeInsurancePolicy.php +++ b/src/CasParser/UnifiedResponse/Insurance/LifeInsurancePolicy.php @@ -11,14 +11,14 @@ /** * @phpstan-type life_insurance_policy = array{ * additionalInfo?: mixed, - * lifeAssured?: string|null, - * policyName?: string|null, - * policyNumber?: string|null, - * premiumAmount?: float|null, - * premiumFrequency?: string|null, - * provider?: string|null, - * status?: string|null, - * sumAssured?: float|null, + * lifeAssured?: string, + * policyName?: string, + * policyNumber?: string, + * premiumAmount?: float, + * premiumFrequency?: string, + * provider?: string, + * status?: string, + * sumAssured?: float, * } */ final class LifeInsurancePolicy implements BaseModel diff --git a/src/CasParser/UnifiedResponse/Investor.php b/src/CasParser/UnifiedResponse/Investor.php index e2befea..dd04ddc 100644 --- a/src/CasParser/UnifiedResponse/Investor.php +++ b/src/CasParser/UnifiedResponse/Investor.php @@ -10,13 +10,13 @@ /** * @phpstan-type investor_alias = array{ - * address?: string|null, - * casID?: string|null, - * email?: string|null, - * mobile?: string|null, - * name?: string|null, - * pan?: string|null, - * pincode?: string|null, + * address?: string, + * casID?: string, + * email?: string, + * mobile?: string, + * name?: string, + * pan?: string, + * pincode?: string, * } */ final class Investor implements BaseModel diff --git a/src/CasParser/UnifiedResponse/Meta.php b/src/CasParser/UnifiedResponse/Meta.php index a77acff..7f55cb7 100644 --- a/src/CasParser/UnifiedResponse/Meta.php +++ b/src/CasParser/UnifiedResponse/Meta.php @@ -12,9 +12,9 @@ /** * @phpstan-type meta_alias = array{ - * casType?: value-of|null, - * generatedAt?: \DateTimeInterface|null, - * statementPeriod?: StatementPeriod|null, + * casType?: value-of, + * generatedAt?: \DateTimeInterface, + * statementPeriod?: StatementPeriod, * } */ final class Meta implements BaseModel diff --git a/src/CasParser/UnifiedResponse/Meta/StatementPeriod.php b/src/CasParser/UnifiedResponse/Meta/StatementPeriod.php index eb49ce1..ebeb0f2 100644 --- a/src/CasParser/UnifiedResponse/Meta/StatementPeriod.php +++ b/src/CasParser/UnifiedResponse/Meta/StatementPeriod.php @@ -10,7 +10,7 @@ /** * @phpstan-type statement_period = array{ - * from?: \DateTimeInterface|null, to?: \DateTimeInterface|null + * from?: \DateTimeInterface, to?: \DateTimeInterface * } */ final class StatementPeriod implements BaseModel diff --git a/src/CasParser/UnifiedResponse/MutualFund.php b/src/CasParser/UnifiedResponse/MutualFund.php index f95a9f8..2f1da0c 100644 --- a/src/CasParser/UnifiedResponse/MutualFund.php +++ b/src/CasParser/UnifiedResponse/MutualFund.php @@ -12,12 +12,12 @@ /** * @phpstan-type mutual_fund = array{ - * additionalInfo?: AdditionalInfo|null, - * amc?: string|null, - * folioNumber?: string|null, - * registrar?: string|null, - * schemes?: list|null, - * value?: float|null, + * additionalInfo?: AdditionalInfo, + * amc?: string, + * folioNumber?: string, + * registrar?: string, + * schemes?: list, + * value?: float, * } */ final class MutualFund implements BaseModel diff --git a/src/CasParser/UnifiedResponse/MutualFund/AdditionalInfo.php b/src/CasParser/UnifiedResponse/MutualFund/AdditionalInfo.php index bf28a8b..b79ad23 100644 --- a/src/CasParser/UnifiedResponse/MutualFund/AdditionalInfo.php +++ b/src/CasParser/UnifiedResponse/MutualFund/AdditionalInfo.php @@ -12,7 +12,7 @@ * Additional folio information. * * @phpstan-type additional_info = array{ - * kyc?: string|null, pan?: string|null, pankyc?: string|null + * kyc?: string, pan?: string, pankyc?: string * } */ final class AdditionalInfo implements BaseModel diff --git a/src/CasParser/UnifiedResponse/MutualFund/Scheme.php b/src/CasParser/UnifiedResponse/MutualFund/Scheme.php index f5f45e7..8775dbb 100644 --- a/src/CasParser/UnifiedResponse/MutualFund/Scheme.php +++ b/src/CasParser/UnifiedResponse/MutualFund/Scheme.php @@ -14,17 +14,17 @@ /** * @phpstan-type scheme_alias = array{ - * additionalInfo?: AdditionalInfo|null, - * cost?: float|null, - * gain?: Gain|null, - * isin?: string|null, - * name?: string|null, - * nav?: float|null, - * nominees?: list|null, - * transactions?: list|null, - * type?: value-of|null, - * units?: float|null, - * value?: float|null, + * additionalInfo?: AdditionalInfo, + * cost?: float, + * gain?: Gain, + * isin?: string, + * name?: string, + * nav?: float, + * nominees?: list, + * transactions?: list, + * type?: value-of, + * units?: float, + * value?: float, * } */ final class Scheme implements BaseModel diff --git a/src/CasParser/UnifiedResponse/MutualFund/Scheme/AdditionalInfo.php b/src/CasParser/UnifiedResponse/MutualFund/Scheme/AdditionalInfo.php index d12d703..e5f16cd 100644 --- a/src/CasParser/UnifiedResponse/MutualFund/Scheme/AdditionalInfo.php +++ b/src/CasParser/UnifiedResponse/MutualFund/Scheme/AdditionalInfo.php @@ -12,11 +12,11 @@ * Additional information specific to the scheme. * * @phpstan-type additional_info = array{ - * advisor?: string|null, - * amfi?: string|null, - * closeUnits?: float|null, - * openUnits?: float|null, - * rtaCode?: string|null, + * advisor?: string, + * amfi?: string, + * closeUnits?: float, + * openUnits?: float, + * rtaCode?: string, * } */ final class AdditionalInfo implements BaseModel diff --git a/src/CasParser/UnifiedResponse/MutualFund/Scheme/Gain.php b/src/CasParser/UnifiedResponse/MutualFund/Scheme/Gain.php index f951aba..8006cfa 100644 --- a/src/CasParser/UnifiedResponse/MutualFund/Scheme/Gain.php +++ b/src/CasParser/UnifiedResponse/MutualFund/Scheme/Gain.php @@ -9,7 +9,7 @@ use CasParser\Core\Contracts\BaseModel; /** - * @phpstan-type gain_alias = array{absolute?: float|null, percentage?: float|null} + * @phpstan-type gain_alias = array{absolute?: float, percentage?: float} */ final class Gain implements BaseModel { diff --git a/src/CasParser/UnifiedResponse/MutualFund/Scheme/Transaction.php b/src/CasParser/UnifiedResponse/MutualFund/Scheme/Transaction.php index 90f6ad6..0ea64d4 100644 --- a/src/CasParser/UnifiedResponse/MutualFund/Scheme/Transaction.php +++ b/src/CasParser/UnifiedResponse/MutualFund/Scheme/Transaction.php @@ -10,14 +10,14 @@ /** * @phpstan-type transaction_alias = array{ - * amount?: float|null, - * balance?: float|null, - * date?: \DateTimeInterface|null, - * description?: string|null, - * dividendRate?: float|null, - * nav?: float|null, - * type?: string|null, - * units?: float|null, + * amount?: float, + * balance?: float, + * date?: \DateTimeInterface, + * description?: string, + * dividendRate?: float, + * nav?: float, + * type?: string, + * units?: float, * } */ final class Transaction implements BaseModel diff --git a/src/CasParser/UnifiedResponse/Summary.php b/src/CasParser/UnifiedResponse/Summary.php index 0b9d4fb..6b32295 100644 --- a/src/CasParser/UnifiedResponse/Summary.php +++ b/src/CasParser/UnifiedResponse/Summary.php @@ -10,9 +10,7 @@ use CasParser\Core\Contracts\BaseModel; /** - * @phpstan-type summary_alias = array{ - * accounts?: Accounts|null, totalValue?: float|null - * } + * @phpstan-type summary_alias = array{accounts?: Accounts, totalValue?: float} */ final class Summary implements BaseModel { diff --git a/src/CasParser/UnifiedResponse/Summary/Accounts.php b/src/CasParser/UnifiedResponse/Summary/Accounts.php index d80af8b..82b1f21 100644 --- a/src/CasParser/UnifiedResponse/Summary/Accounts.php +++ b/src/CasParser/UnifiedResponse/Summary/Accounts.php @@ -13,7 +13,7 @@ /** * @phpstan-type accounts_alias = array{ - * demat?: Demat|null, insurance?: Insurance|null, mutualFunds?: MutualFunds|null + * demat?: Demat, insurance?: Insurance, mutualFunds?: MutualFunds * } */ final class Accounts implements BaseModel diff --git a/src/CasParser/UnifiedResponse/Summary/Accounts/Demat.php b/src/CasParser/UnifiedResponse/Summary/Accounts/Demat.php index 8eb9bf5..50165c2 100644 --- a/src/CasParser/UnifiedResponse/Summary/Accounts/Demat.php +++ b/src/CasParser/UnifiedResponse/Summary/Accounts/Demat.php @@ -9,7 +9,7 @@ use CasParser\Core\Contracts\BaseModel; /** - * @phpstan-type demat_alias = array{count?: int|null, totalValue?: float|null} + * @phpstan-type demat_alias = array{count?: int, totalValue?: float} */ final class Demat implements BaseModel { diff --git a/src/CasParser/UnifiedResponse/Summary/Accounts/Insurance.php b/src/CasParser/UnifiedResponse/Summary/Accounts/Insurance.php index fce66f1..a14d733 100644 --- a/src/CasParser/UnifiedResponse/Summary/Accounts/Insurance.php +++ b/src/CasParser/UnifiedResponse/Summary/Accounts/Insurance.php @@ -9,7 +9,7 @@ use CasParser\Core\Contracts\BaseModel; /** - * @phpstan-type insurance_alias = array{count?: int|null, totalValue?: float|null} + * @phpstan-type insurance_alias = array{count?: int, totalValue?: float} */ final class Insurance implements BaseModel { diff --git a/src/CasParser/UnifiedResponse/Summary/Accounts/MutualFunds.php b/src/CasParser/UnifiedResponse/Summary/Accounts/MutualFunds.php index 9ce16cb..dc2f0c0 100644 --- a/src/CasParser/UnifiedResponse/Summary/Accounts/MutualFunds.php +++ b/src/CasParser/UnifiedResponse/Summary/Accounts/MutualFunds.php @@ -9,7 +9,7 @@ use CasParser\Core\Contracts\BaseModel; /** - * @phpstan-type mutual_funds = array{count?: int|null, totalValue?: float|null} + * @phpstan-type mutual_funds = array{count?: int, totalValue?: float} */ final class MutualFunds implements BaseModel { diff --git a/src/Core/Implementation/HasRawResponse.php b/src/Core/Implementation/HasRawResponse.php new file mode 100644 index 0000000..d3ffd67 --- /dev/null +++ b/src/Core/Implementation/HasRawResponse.php @@ -0,0 +1,10 @@ + $casAuthority CAS authority to generate the document from (currently only kfintech is supported) * @param string $panNo PAN number (optional for some CAS authorities) + * + * @return CasGeneratorGenerateCasResponse */ public function generateCas( $email, diff --git a/src/ServiceContracts/CasParserContract.php b/src/ServiceContracts/CasParserContract.php index 1d1a4f2..e659424 100644 --- a/src/ServiceContracts/CasParserContract.php +++ b/src/ServiceContracts/CasParserContract.php @@ -5,6 +5,7 @@ namespace CasParser\ServiceContracts; use CasParser\CasParser\UnifiedResponse; +use CasParser\Core\Implementation\HasRawResponse; use CasParser\RequestOptions; use const CasParser\Core\OMIT as omit; @@ -17,6 +18,8 @@ interface CasParserContract * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function camsKfintech( $password = omit, @@ -31,6 +34,8 @@ public function camsKfintech( * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function cdsl( $password = omit, @@ -45,6 +50,8 @@ public function cdsl( * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function nsdl( $password = omit, @@ -59,6 +66,8 @@ public function nsdl( * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function smartParse( $password = omit, diff --git a/src/Services/CasGeneratorService.php b/src/Services/CasGeneratorService.php index 38f80d7..675540e 100644 --- a/src/Services/CasGeneratorService.php +++ b/src/Services/CasGeneratorService.php @@ -8,6 +8,7 @@ use CasParser\CasGenerator\CasGeneratorGenerateCasParams\CasAuthority; use CasParser\CasGenerator\CasGeneratorGenerateCasResponse; use CasParser\Client; +use CasParser\Core\Implementation\HasRawResponse; use CasParser\RequestOptions; use CasParser\ServiceContracts\CasGeneratorContract; @@ -32,6 +33,8 @@ public function __construct(private Client $client) {} * @param string $toDate End date for the CAS period (format YYYY-MM-DD) * @param CasAuthority|value-of $casAuthority CAS authority to generate the document from (currently only kfintech is supported) * @param string $panNo PAN number (optional for some CAS authorities) + * + * @return CasGeneratorGenerateCasResponse */ public function generateCas( $email, diff --git a/src/Services/CasParserService.php b/src/Services/CasParserService.php index 883ee5f..be2c1bf 100644 --- a/src/Services/CasParserService.php +++ b/src/Services/CasParserService.php @@ -10,6 +10,7 @@ use CasParser\CasParser\CasParserSmartParseParams; use CasParser\CasParser\UnifiedResponse; use CasParser\Client; +use CasParser\Core\Implementation\HasRawResponse; use CasParser\RequestOptions; use CasParser\ServiceContracts\CasParserContract; @@ -31,6 +32,8 @@ public function __construct(private Client $client) {} * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function camsKfintech( $password = omit, @@ -62,6 +65,8 @@ public function camsKfintech( * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function cdsl( $password = omit, @@ -93,6 +98,8 @@ public function cdsl( * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function nsdl( $password = omit, @@ -124,6 +131,8 @@ public function nsdl( * @param string $password Password for the PDF file (if required) * @param string $pdfFile Base64 encoded CAS PDF file * @param string $pdfURL URL to the CAS PDF file + * + * @return UnifiedResponse */ public function smartParse( $password = omit, From cec98f994a8f4b1dc12905a2dcd269cebbcc000d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 13 Sep 2025 02:35:44 +0000 Subject: [PATCH 8/9] feat(client): add raw methods --- .../CasGeneratorGenerateCasResponse.php | 2 +- src/CasParser/UnifiedResponse.php | 2 +- src/ServiceContracts/CasGeneratorContract.php | 17 +++ src/ServiceContracts/CasParserContract.php | 65 +++++++++++ src/Services/CasGeneratorService.php | 39 +++++-- src/Services/CasParserService.php | 105 ++++++++++++++++-- 6 files changed, 211 insertions(+), 19 deletions(-) diff --git a/src/CasGenerator/CasGeneratorGenerateCasResponse.php b/src/CasGenerator/CasGeneratorGenerateCasResponse.php index b05b566..86298f8 100644 --- a/src/CasGenerator/CasGeneratorGenerateCasResponse.php +++ b/src/CasGenerator/CasGeneratorGenerateCasResponse.php @@ -12,7 +12,7 @@ * @phpstan-type cas_generator_generate_cas_response = array{ * msg?: string, status?: string * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/CasParser/UnifiedResponse.php b/src/CasParser/UnifiedResponse.php index 8553bdf..0eda57c 100644 --- a/src/CasParser/UnifiedResponse.php +++ b/src/CasParser/UnifiedResponse.php @@ -23,7 +23,7 @@ * mutualFunds?: list, * summary?: Summary, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/ServiceContracts/CasGeneratorContract.php b/src/ServiceContracts/CasGeneratorContract.php index a0f96dd..240aad8 100644 --- a/src/ServiceContracts/CasGeneratorContract.php +++ b/src/ServiceContracts/CasGeneratorContract.php @@ -6,6 +6,7 @@ use CasParser\CasGenerator\CasGeneratorGenerateCasParams\CasAuthority; use CasParser\CasGenerator\CasGeneratorGenerateCasResponse; +use CasParser\Core\Exceptions\APIException; use CasParser\Core\Implementation\HasRawResponse; use CasParser\RequestOptions; @@ -24,6 +25,8 @@ interface CasGeneratorContract * @param string $panNo PAN number (optional for some CAS authorities) * * @return CasGeneratorGenerateCasResponse + * + * @throws APIException */ public function generateCas( $email, @@ -34,4 +37,18 @@ public function generateCas( $panNo = omit, ?RequestOptions $requestOptions = null, ): CasGeneratorGenerateCasResponse; + + /** + * @api + * + * @param array $params + * + * @return CasGeneratorGenerateCasResponse + * + * @throws APIException + */ + public function generateCasRaw( + array $params, + ?RequestOptions $requestOptions = null + ): CasGeneratorGenerateCasResponse; } diff --git a/src/ServiceContracts/CasParserContract.php b/src/ServiceContracts/CasParserContract.php index e659424..c21836f 100644 --- a/src/ServiceContracts/CasParserContract.php +++ b/src/ServiceContracts/CasParserContract.php @@ -5,6 +5,7 @@ namespace CasParser\ServiceContracts; use CasParser\CasParser\UnifiedResponse; +use CasParser\Core\Exceptions\APIException; use CasParser\Core\Implementation\HasRawResponse; use CasParser\RequestOptions; @@ -20,6 +21,8 @@ interface CasParserContract * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function camsKfintech( $password = omit, @@ -28,6 +31,20 @@ public function camsKfintech( ?RequestOptions $requestOptions = null, ): UnifiedResponse; + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function camsKfintechRaw( + array $params, + ?RequestOptions $requestOptions = null + ): UnifiedResponse; + /** * @api * @@ -36,6 +53,8 @@ public function camsKfintech( * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function cdsl( $password = omit, @@ -44,6 +63,20 @@ public function cdsl( ?RequestOptions $requestOptions = null, ): UnifiedResponse; + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function cdslRaw( + array $params, + ?RequestOptions $requestOptions = null + ): UnifiedResponse; + /** * @api * @@ -52,6 +85,8 @@ public function cdsl( * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function nsdl( $password = omit, @@ -60,6 +95,20 @@ public function nsdl( ?RequestOptions $requestOptions = null, ): UnifiedResponse; + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function nsdlRaw( + array $params, + ?RequestOptions $requestOptions = null + ): UnifiedResponse; + /** * @api * @@ -68,6 +117,8 @@ public function nsdl( * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function smartParse( $password = omit, @@ -75,4 +126,18 @@ public function smartParse( $pdfURL = omit, ?RequestOptions $requestOptions = null, ): UnifiedResponse; + + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function smartParseRaw( + array $params, + ?RequestOptions $requestOptions = null + ): UnifiedResponse; } diff --git a/src/Services/CasGeneratorService.php b/src/Services/CasGeneratorService.php index 675540e..c7d2e8e 100644 --- a/src/Services/CasGeneratorService.php +++ b/src/Services/CasGeneratorService.php @@ -8,6 +8,7 @@ use CasParser\CasGenerator\CasGeneratorGenerateCasParams\CasAuthority; use CasParser\CasGenerator\CasGeneratorGenerateCasResponse; use CasParser\Client; +use CasParser\Core\Exceptions\APIException; use CasParser\Core\Implementation\HasRawResponse; use CasParser\RequestOptions; use CasParser\ServiceContracts\CasGeneratorContract; @@ -35,6 +36,8 @@ public function __construct(private Client $client) {} * @param string $panNo PAN number (optional for some CAS authorities) * * @return CasGeneratorGenerateCasResponse + * + * @throws APIException */ public function generateCas( $email, @@ -44,17 +47,35 @@ public function generateCas( $casAuthority = omit, $panNo = omit, ?RequestOptions $requestOptions = null, + ): CasGeneratorGenerateCasResponse { + $params = [ + 'email' => $email, + 'fromDate' => $fromDate, + 'password' => $password, + 'toDate' => $toDate, + 'casAuthority' => $casAuthority, + 'panNo' => $panNo, + ]; + + return $this->generateCasRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return CasGeneratorGenerateCasResponse + * + * @throws APIException + */ + public function generateCasRaw( + array $params, + ?RequestOptions $requestOptions = null ): CasGeneratorGenerateCasResponse { [$parsed, $options] = CasGeneratorGenerateCasParams::parseRequest( - [ - 'email' => $email, - 'fromDate' => $fromDate, - 'password' => $password, - 'toDate' => $toDate, - 'casAuthority' => $casAuthority, - 'panNo' => $panNo, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; diff --git a/src/Services/CasParserService.php b/src/Services/CasParserService.php index be2c1bf..8c2adff 100644 --- a/src/Services/CasParserService.php +++ b/src/Services/CasParserService.php @@ -10,6 +10,7 @@ use CasParser\CasParser\CasParserSmartParseParams; use CasParser\CasParser\UnifiedResponse; use CasParser\Client; +use CasParser\Core\Exceptions\APIException; use CasParser\Core\Implementation\HasRawResponse; use CasParser\RequestOptions; use CasParser\ServiceContracts\CasParserContract; @@ -34,16 +35,38 @@ public function __construct(private Client $client) {} * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function camsKfintech( $password = omit, $pdfFile = omit, $pdfURL = omit, ?RequestOptions $requestOptions = null, + ): UnifiedResponse { + $params = [ + 'password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL, + ]; + + return $this->camsKfintechRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function camsKfintechRaw( + array $params, + ?RequestOptions $requestOptions = null ): UnifiedResponse { [$parsed, $options] = CasParserCamsKfintechParams::parseRequest( - ['password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -67,16 +90,38 @@ public function camsKfintech( * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function cdsl( $password = omit, $pdfFile = omit, $pdfURL = omit, ?RequestOptions $requestOptions = null, + ): UnifiedResponse { + $params = [ + 'password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL, + ]; + + return $this->cdslRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function cdslRaw( + array $params, + ?RequestOptions $requestOptions = null ): UnifiedResponse { [$parsed, $options] = CasParserCdslParams::parseRequest( - ['password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -100,16 +145,38 @@ public function cdsl( * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function nsdl( $password = omit, $pdfFile = omit, $pdfURL = omit, ?RequestOptions $requestOptions = null, + ): UnifiedResponse { + $params = [ + 'password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL, + ]; + + return $this->nsdlRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function nsdlRaw( + array $params, + ?RequestOptions $requestOptions = null ): UnifiedResponse { [$parsed, $options] = CasParserNsdlParams::parseRequest( - ['password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -133,16 +200,38 @@ public function nsdl( * @param string $pdfURL URL to the CAS PDF file * * @return UnifiedResponse + * + * @throws APIException */ public function smartParse( $password = omit, $pdfFile = omit, $pdfURL = omit, ?RequestOptions $requestOptions = null, + ): UnifiedResponse { + $params = [ + 'password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL, + ]; + + return $this->smartParseRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return UnifiedResponse + * + * @throws APIException + */ + public function smartParseRaw( + array $params, + ?RequestOptions $requestOptions = null ): UnifiedResponse { [$parsed, $options] = CasParserSmartParseParams::parseRequest( - ['password' => $password, 'pdfFile' => $pdfFile, 'pdfURL' => $pdfURL], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; From e071b1bb9480ca3d28e8d2f8befb26ec21371588 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 13 Sep 2025 02:36:01 +0000 Subject: [PATCH 9/9] release: 0.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3d2ac0b..10f3091 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.2.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a8e525..57b6fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 0.2.0 (2025-09-13) + +Full Changelog: [v0.1.0...v0.2.0](https://github.com/CASParser/cas-parser-php/compare/v0.1.0...v0.2.0) + +### ⚠ BREAKING CHANGES + +* expose services and service contracts + +### Features + +* **client:** add raw methods ([cec98f9](https://github.com/CASParser/cas-parser-php/commit/cec98f994a8f4b1dc12905a2dcd269cebbcc000d)) +* **client:** support raw responses ([db0fac3](https://github.com/CASParser/cas-parser-php/commit/db0fac37cc5a9f56fb8f095f4c895f91a206bfa5)) +* **client:** use real enums ([9b7428f](https://github.com/CASParser/cas-parser-php/commit/9b7428ffe0e2a19b1b7ad6c87e90ee14eddce749)) +* expose services and service contracts ([36e3c1d](https://github.com/CASParser/cas-parser-php/commit/36e3c1d53c72f8b86e8ccf565fd3399bb3847834)) + + +### Chores + +* cleanup streaming ([d8d2163](https://github.com/CASParser/cas-parser-php/commit/d8d2163afa66e726f571c31276eaca485c4dda84)) +* document parameter object usage ([8e520a0](https://github.com/CASParser/cas-parser-php/commit/8e520a0452175fc10becdd28fc9bf5b37cecf434)) +* fix lints in UnionOf ([4fcc712](https://github.com/CASParser/cas-parser-php/commit/4fcc712c36036429b1f410f3c3ae88f3a8ad3147)) +* make more targeted phpstan ignores ([35208e4](https://github.com/CASParser/cas-parser-php/commit/35208e4d7fced2de5826111980cfd51bebd1ad74)) + ## 0.1.0 (2025-09-03) Full Changelog: [v0.0.2...v0.1.0](https://github.com/CASParser/cas-parser-php/compare/v0.0.2...v0.1.0)