Skip to content

Commit 640d950

Browse files
committed
Reproduce SOAP extension issues
phpstan/phpstan#618
1 parent f6117d7 commit 640d950

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,10 @@ jobs:
461461
- script: "bin/phpstan analyse -l 8 -a tests/e2e/data/timecop.php tests/e2e/data/timecop.php"
462462
tools: "pecl"
463463
extensions: "timecop-beta"
464+
- script: "bin/phpstan analyse -l 8 -a tests/e2e/data/soap.php tests/e2e/data/soap.php"
465+
extensions: "soap"
466+
- script: "bin/phpstan analyse -l 8 -a tests/e2e/data/soap.php tests/e2e/data/soap.php"
467+
extensions: ""
464468

465469
steps:
466470
- name: "Checkout"

tests/e2e/data/soap.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
namespace SoapTests;
4+
5+
use SoapFault;
6+
7+
class MySoapClient extends \SoapClient
8+
{
9+
10+
}
11+
12+
class MySoapClient2 extends \SoapClient
13+
{
14+
15+
/**
16+
* @param string|null $wsdl
17+
* @param mixed[]|null $options
18+
*/
19+
public function __construct($wsdl, array $options = null)
20+
{
21+
parent::__construct($wsdl, $options);
22+
}
23+
}
24+
25+
class MySoapClient3 extends \SoapClient
26+
{
27+
28+
/**
29+
* @param string|null $wsdl
30+
* @param mixed[]|null $options
31+
*/
32+
public function __construct($wsdl, array $options = null)
33+
{
34+
parent::SoapClient($wsdl, $options);
35+
}
36+
}
37+
38+
function () {
39+
$soap = new MySoapClient('some.wsdl', ['soap_version' => SOAP_1_2]);
40+
$soap = new MySoapClient2('some.wsdl', ['soap_version' => SOAP_1_2]);
41+
$soap = new MySoapClient3('some.wsdl', ['soap_version' => SOAP_1_2]);
42+
};
43+
44+
class MySoapHeader extends \SoapHeader
45+
{
46+
47+
public function __construct(string $username, string $password)
48+
{
49+
parent::__construct($username, $password);
50+
}
51+
52+
}
53+
54+
function () {
55+
$header = new MySoapHeader('user', 'passw0rd');
56+
};
57+
58+
function (\SoapFault $fault) {
59+
echo $fault->faultcode;
60+
echo $fault->faultstring;
61+
};

0 commit comments

Comments
 (0)