Skip to content

Commit 16e7c95

Browse files
feat: ensure ->toArray() benefits from structural typing
1 parent 961e540 commit 16e7c95

35 files changed

+277
-8
lines changed

src/CasGenerator/CasGeneratorGenerateCasParams.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@
1313
/**
1414
* This endpoint generates CAS (Consolidated Account Statement) documents by submitting a mailback request to the specified CAS authority.
1515
* Currently only supports KFintech, with plans to support CAMS, CDSL, and NSDL in the future.
16+
*
17+
* @phpstan-type cas_generator_generate_cas_params = array{
18+
* email: string,
19+
* fromDate: string,
20+
* password: string,
21+
* toDate: string,
22+
* casAuthority?: CasAuthority::*,
23+
* panNo?: string,
24+
* }
1625
*/
1726
final class CasGeneratorGenerateCasParams implements BaseModel
1827
{
28+
/** @use SdkModel<cas_generator_generate_cas_params> */
1929
use SdkModel;
2030
use SdkParams;
2131

src/CasGenerator/CasGeneratorGenerateCasResponse.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
use CasParser\Core\Concerns\SdkModel;
99
use CasParser\Core\Contracts\BaseModel;
1010

11+
/**
12+
* @phpstan-type cas_generator_generate_cas_response = array{
13+
* msg?: string|null, status?: string|null
14+
* }
15+
*/
1116
final class CasGeneratorGenerateCasResponse implements BaseModel
1217
{
18+
/** @use SdkModel<cas_generator_generate_cas_response> */
1319
use SdkModel;
1420

1521
#[Api(optional: true)]

src/CasParser/CasParserCamsKfintechParams.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
/**
1313
* This endpoint specifically parses CAMS/KFintech CAS (Consolidated Account Statement) PDF files and returns data in a unified format.
1414
* Use this endpoint when you know the PDF is from CAMS or KFintech.
15+
*
16+
* @phpstan-type cas_parser_cams_kfintech_params = array{
17+
* password?: string, pdfFile?: string, pdfURL?: string
18+
* }
1519
*/
1620
final class CasParserCamsKfintechParams implements BaseModel
1721
{
22+
/** @use SdkModel<cas_parser_cams_kfintech_params> */
1823
use SdkModel;
1924
use SdkParams;
2025

src/CasParser/CasParserCdslParams.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
/**
1313
* This endpoint specifically parses CDSL CAS (Consolidated Account Statement) PDF files and returns data in a unified format.
1414
* Use this endpoint when you know the PDF is from CDSL.
15+
*
16+
* @phpstan-type cas_parser_cdsl_params = array{
17+
* password?: string, pdfFile?: string, pdfURL?: string
18+
* }
1519
*/
1620
final class CasParserCdslParams implements BaseModel
1721
{
22+
/** @use SdkModel<cas_parser_cdsl_params> */
1823
use SdkModel;
1924
use SdkParams;
2025

src/CasParser/CasParserNsdlParams.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
/**
1313
* This endpoint specifically parses NSDL CAS (Consolidated Account Statement) PDF files and returns data in a unified format.
1414
* Use this endpoint when you know the PDF is from NSDL.
15+
*
16+
* @phpstan-type cas_parser_nsdl_params = array{
17+
* password?: string, pdfFile?: string, pdfURL?: string
18+
* }
1519
*/
1620
final class CasParserNsdlParams implements BaseModel
1721
{
22+
/** @use SdkModel<cas_parser_nsdl_params> */
1823
use SdkModel;
1924
use SdkParams;
2025

src/CasParser/CasParserSmartParseParams.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
/**
1313
* This endpoint parses CAS (Consolidated Account Statement) PDF files from NSDL, CDSL, or CAMS/KFintech and returns data in a unified format.
1414
* It auto-detects the CAS type and transforms the data into a consistent structure regardless of the source.
15+
*
16+
* @phpstan-type cas_parser_smart_parse_params = array{
17+
* password?: string, pdfFile?: string, pdfURL?: string
18+
* }
1519
*/
1620
final class CasParserSmartParseParams implements BaseModel
1721
{
22+
/** @use SdkModel<cas_parser_smart_parse_params> */
1823
use SdkModel;
1924
use SdkParams;
2025

src/CasParser/UnifiedResponse.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@
1414
use CasParser\Core\Concerns\SdkModel;
1515
use CasParser\Core\Contracts\BaseModel;
1616

17+
/**
18+
* @phpstan-type unified_response = array{
19+
* dematAccounts?: list<DematAccount>|null,
20+
* insurance?: Insurance|null,
21+
* investor?: Investor|null,
22+
* meta?: Meta|null,
23+
* mutualFunds?: list<MutualFund>|null,
24+
* summary?: Summary|null,
25+
* }
26+
*/
1727
final class UnifiedResponse implements BaseModel
1828
{
29+
/** @use SdkModel<unified_response> */
1930
use SdkModel;
2031

2132
/** @var list<DematAccount>|null $dematAccounts */

src/CasParser/UnifiedResponse/DematAccount.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,21 @@
1111
use CasParser\Core\Concerns\SdkModel;
1212
use CasParser\Core\Contracts\BaseModel;
1313

14+
/**
15+
* @phpstan-type demat_account = array{
16+
* additionalInfo?: AdditionalInfo|null,
17+
* boID?: string|null,
18+
* clientID?: string|null,
19+
* dematType?: DematType::*|null,
20+
* dpID?: string|null,
21+
* dpName?: string|null,
22+
* holdings?: Holdings|null,
23+
* value?: float|null,
24+
* }
25+
*/
1426
final class DematAccount implements BaseModel
1527
{
28+
/** @use SdkModel<demat_account> */
1629
use SdkModel;
1730

1831
/**

src/CasParser/UnifiedResponse/DematAccount/AdditionalInfo.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@
1010

1111
/**
1212
* Additional information specific to the demat account type.
13+
*
14+
* @phpstan-type additional_info = array{
15+
* boStatus?: string|null,
16+
* boSubStatus?: string|null,
17+
* boType?: string|null,
18+
* bsda?: string|null,
19+
* email?: string|null,
20+
* linkedPans?: list<string>|null,
21+
* nominee?: string|null,
22+
* status?: string|null,
23+
* }
1324
*/
1425
final class AdditionalInfo implements BaseModel
1526
{
27+
/** @use SdkModel<additional_info> */
1628
use SdkModel;
1729

1830
/**

src/CasParser/UnifiedResponse/DematAccount/Holdings.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@
1313
use CasParser\Core\Concerns\SdkModel;
1414
use CasParser\Core\Contracts\BaseModel;
1515

16+
/**
17+
* @phpstan-type holdings_alias = array{
18+
* aifs?: list<Aif>|null,
19+
* corporateBonds?: list<CorporateBond>|null,
20+
* dematMutualFunds?: list<DematMutualFund>|null,
21+
* equities?: list<Equity>|null,
22+
* governmentSecurities?: list<GovernmentSecurity>|null,
23+
* }
24+
*/
1625
final class Holdings implements BaseModel
1726
{
27+
/** @use SdkModel<holdings_alias> */
1828
use SdkModel;
1929

2030
/** @var list<Aif>|null $aifs */

0 commit comments

Comments
 (0)