1515use CasParser \Core \Util ;
1616use CasParser \RequestOptions ;
1717
18+ use const CasParser \Core \OMIT as omit ;
19+
1820final class CasParserService implements CasParserContract
1921{
2022 public function __construct (private Client $ client ) {}
@@ -28,15 +30,14 @@ public function __construct(private Client $client) {}
2830 * @param string $pdfURL URL to the CAS PDF file
2931 */
3032 public function camsKfintech (
31- $ password = null ,
32- $ pdfFile = null ,
33- $ pdfURL = null ,
33+ $ password = omit ,
34+ $ pdfFile = omit ,
35+ $ pdfURL = omit ,
3436 ?RequestOptions $ requestOptions = null ,
3537 ): UnifiedResponse {
36- $ args = [
37- 'password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ,
38- ];
39- $ args = Util::array_filter_null ($ args , ['password ' , 'pdfFile ' , 'pdfURL ' ]);
38+ $ args = Util::array_filter_omit (
39+ ['password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ]
40+ );
4041 [$ parsed , $ options ] = CasParserCamsKfintechParams::parseRequest (
4142 $ args ,
4243 $ requestOptions
@@ -61,15 +62,14 @@ public function camsKfintech(
6162 * @param string $pdfURL URL to the CAS PDF file
6263 */
6364 public function cdsl (
64- $ password = null ,
65- $ pdfFile = null ,
66- $ pdfURL = null ,
65+ $ password = omit ,
66+ $ pdfFile = omit ,
67+ $ pdfURL = omit ,
6768 ?RequestOptions $ requestOptions = null ,
6869 ): UnifiedResponse {
69- $ args = [
70- 'password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ,
71- ];
72- $ args = Util::array_filter_null ($ args , ['password ' , 'pdfFile ' , 'pdfURL ' ]);
70+ $ args = Util::array_filter_omit (
71+ ['password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ]
72+ );
7373 [$ parsed , $ options ] = CasParserCdslParams::parseRequest (
7474 $ args ,
7575 $ requestOptions
@@ -94,15 +94,14 @@ public function cdsl(
9494 * @param string $pdfURL URL to the CAS PDF file
9595 */
9696 public function nsdl (
97- $ password = null ,
98- $ pdfFile = null ,
99- $ pdfURL = null ,
97+ $ password = omit ,
98+ $ pdfFile = omit ,
99+ $ pdfURL = omit ,
100100 ?RequestOptions $ requestOptions = null ,
101101 ): UnifiedResponse {
102- $ args = [
103- 'password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ,
104- ];
105- $ args = Util::array_filter_null ($ args , ['password ' , 'pdfFile ' , 'pdfURL ' ]);
102+ $ args = Util::array_filter_omit (
103+ ['password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ]
104+ );
106105 [$ parsed , $ options ] = CasParserNsdlParams::parseRequest (
107106 $ args ,
108107 $ requestOptions
@@ -127,15 +126,14 @@ public function nsdl(
127126 * @param string $pdfURL URL to the CAS PDF file
128127 */
129128 public function smartParse (
130- $ password = null ,
131- $ pdfFile = null ,
132- $ pdfURL = null ,
129+ $ password = omit ,
130+ $ pdfFile = omit ,
131+ $ pdfURL = omit ,
133132 ?RequestOptions $ requestOptions = null ,
134133 ): UnifiedResponse {
135- $ args = [
136- 'password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ,
137- ];
138- $ args = Util::array_filter_null ($ args , ['password ' , 'pdfFile ' , 'pdfURL ' ]);
134+ $ args = Util::array_filter_omit (
135+ ['password ' => $ password , 'pdfFile ' => $ pdfFile , 'pdfURL ' => $ pdfURL ]
136+ );
139137 [$ parsed , $ options ] = CasParserSmartParseParams::parseRequest (
140138 $ args ,
141139 $ requestOptions
0 commit comments