File tree Expand file tree Collapse file tree 7 files changed +63
-3
lines changed Expand file tree Collapse file tree 7 files changed +63
-3
lines changed Original file line number Diff line number Diff line change 33
33
- name : Monitor coverage
34
34
uses : slavcodev/coverage-monitor-action@v1
35
35
with :
36
- github_token : ${{ secrets.ACTIONS_GITHUB_TOKEN }}
36
+ github_token : ${{ secrets.GITHUB_TOKEN }}
37
37
coverage_path : coverage.xml
38
38
threshold_alert : 95
39
39
threshold_warning : 90
44
44
- name : SonarCloud Scan
45
45
uses : SonarSource/sonarcloud-github-action@master
46
46
env :
47
- GITHUB_TOKEN : ${{ secrets.ACTIONS_GITHUB_TOKEN }}
47
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
48
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## 5.0.4 - 2024/02/05
4
+ - PR #51 - Fix overriding the custom SoapClient class
5
+
3
6
## 5.0.3 - 2023/02/09
4
7
- PR #38 - type checking exception raised in php8
5
8
Original file line number Diff line number Diff line change 48
48
{
49
49
"name" : " maurobn" ,
50
50
"role" : " Contributor"
51
+ },
52
+ {
53
+ "name" : " Christo Yovev" ,
54
+ "role" : " Contributor"
51
55
}
52
56
],
53
57
"support" : {
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ protected static function canInstantiateSoapClientWithOptions(array $wsdlOptions
100
100
*/
101
101
public function getSoapClientClassName (?string $ soapClientClassName = null ): string
102
102
{
103
- $ className = self ::DEFAULT_SOAP_CLIENT_CLASS ;
103
+ $ className = static ::DEFAULT_SOAP_CLIENT_CLASS ;
104
104
if (!empty ($ soapClientClassName ) && is_subclass_of ($ soapClientClassName , SoapClient::class)) {
105
105
$ className = $ soapClientClassName ;
106
106
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace WsdlToPhp \PackageBase \Tests ;
6
+
7
+ use WsdlToPhp \PackageBase \AbstractSoapClientBase ;
8
+
9
+ /**
10
+ * Services can specify a custom SoapClient class
11
+ * to be used instead of PHP default by overriding
12
+ * the constant below.
13
+ *
14
+ * @see \WsdlToPhp\PackageBase\SoapClientInterface
15
+ * @see \WsdlToPhp\PackageBase\AbstractSoapClientBase :: getSoapClientClassName()
16
+ */
17
+
18
+ class CustomSoapClientService extends AbstractSoapClientBase
19
+ {
20
+
21
+ /**
22
+ * Custom SoapClient class used for current service.
23
+ */
24
+ const DEFAULT_SOAP_CLIENT_CLASS = Client::class;
25
+
26
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace WsdlToPhp \PackageBase \Tests ;
6
+
7
+ use WsdlToPhp \PackageBase \AbstractSoapClientBase ;
8
+
9
+ /**
10
+ * By default all services extending the packagebase's
11
+ * abstract class rely on PHP's default SoapClient.
12
+ */
13
+
14
+ class DefaultSoapClientService extends AbstractSoapClientBase
15
+ {
16
+
17
+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,15 @@ public function testSoapClientNameDefault(): void
25
25
$ this ->assertSame (Client::class, $ soapClient ->getSoapClientClassName (Client::class));
26
26
}
27
27
28
+ public function testCustomSoapClientNameReadFromConstant ()
29
+ {
30
+ $ defaultService = new DefaultSoapClientService ();
31
+ $ customService = new CustomSoapClientService ();
32
+
33
+ $ this ->assertSame (SoapClientBase::class, $ defaultService ->getSoapClientClassName ());
34
+ $ this ->assertSame (Client::class, $ customService ->getSoapClientClassName ());
35
+ }
36
+
28
37
public function testSoapClient (): void
29
38
{
30
39
$ soapClient = new SoapClient ([
@@ -489,4 +498,5 @@ public function testGetOutputHeadersWithoutRequestMustReturnAnEmptyArray(): void
489
498
$ this ->assertTrue (is_array ($ soapClient ->getOutputHeaders ()));
490
499
$ this ->assertEmpty ($ soapClient ->getOutputHeaders ());
491
500
}
501
+
492
502
}
You can’t perform that action at this time.
0 commit comments