Skip to content

Commit 151ffb8

Browse files
committed
Merge branch 'release/5.0.2'
2 parents 3575e50 + 0302017 commit 151ffb8

File tree

7 files changed

+31
-10
lines changed

7 files changed

+31
-10
lines changed

.php_cs renamed to .php-cs-fixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
->exclude('vendor')
55
->in(__DIR__);
66

7-
return PhpCsFixer\Config::create()
7+
return (new PhpCsFixer\Config())
88
->setUsingCache(false)
99
->setRules(array(
1010
'@PSR2' => true,
@@ -15,6 +15,6 @@
1515
'no_whitespace_in_blank_line' => true,
1616
'ternary_operator_spaces' => true,
1717
'cast_spaces' => true,
18-
'trailing_comma_in_multiline_array' => true
18+
'trailing_comma_in_multiline' => true
1919
))
2020
->setFinder($finder);

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 5.0.2 - 2022/08/10
4+
- PR #44 - Add #[\ReturnTypeWillChange] to AbstractStructArrayBase
5+
36
## 5.0.1 - 2021/02/09
47
- Remove trigger_error calls since this is version 5.0 :)
58

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
55
[![License](https://poser.pugx.org/wsdltophp/packagebase/license)](https://packagist.org/packages/wsdltophp/packagebase)
66
[![Latest Stable Version](https://poser.pugx.org/wsdltophp/packagebase/version.png)](https://packagist.org/packages/wsdltophp/packagebase)
7-
[![Build Status](https://travis-ci.com/WsdlToPhp/PackageBase.svg)](https://travis-ci.com/github/WsdlToPhp/PackageBase)
7+
[![TeamCity build status](https://teamcity.mikael-delsol.fr/app/rest/builds/buildType:id:PackageBase_Build/statusIcon.svg)](https://github.com/WsdlToPhp/PackageBase)
88
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/badges/quality-score.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/)
99
[![Code Coverage](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/badges/coverage.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/)
1010
[![Total Downloads](https://poser.pugx.org/wsdltophp/packagebase/downloads)](https://packagist.org/packages/wsdltophp/packagebase)
1111
[![StyleCI](https://styleci.io/repos/38760239/shield)](https://styleci.io/repos/38760239)
12-
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/bfbc0c8f-5793-489b-8151-36ea149ec98d/mini.png)](https://insight.sensiolabs.com/projects/bfbc0c8f-5793-489b-8151-36ea149ec98d)
12+
[![SymfonyInsight](https://insight.symfony.com/projects/081b5b0a-0260-4d3d-94eb-f6610dcc2cb3/mini.svg)](https://insight.symfony.com/projects/081b5b0a-0260-4d3d-94eb-f6610dcc2cb3)
1313

1414
The goal is to provide generic and useful classes that are on top of the classes generated by the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator) project.
1515

composer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"name": "Jacob Dreesen",
4040
"email": "[email protected]",
4141
"role": "Contributor"
42+
},
43+
{
44+
"name": "Karl Pierce",
45+
"email": "[email protected]",
46+
"role": "Contributor"
4247
}
4348
],
4449
"support" : {
@@ -52,10 +57,12 @@
5257
},
5358
"scripts": {
5459
"test": "vendor/bin/phpunit",
55-
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose"
60+
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose",
61+
"phpstan": "vendor/bin/phpstan analyze src --level=3"
5662
},
5763
"require-dev": {
58-
"friendsofphp/php-cs-fixer": "~2.0",
64+
"friendsofphp/php-cs-fixer": "~3.0",
65+
"phpstan/phpstan": "^1.4",
5966
"phpunit/phpunit": "^9"
6067
},
6168
"autoload": {

phpstan.neon.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
parameters:
2+
ignoreErrors:
3+
- '#Access to an undefined property SoapClient::\$_stream_context.#'

src/AbstractSoapClientBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public function setHttpHeader(string $headerName, $headerValue): bool
340340
* Create context if it does not exist
341341
*/
342342
if ($streamContext === null) {
343-
$state = ($this->getSoapClient()->_stream_context = stream_context_create($options)) ? true : false;
343+
$state = is_resource($this->getSoapClient()->_stream_context = stream_context_create($options));
344344
} else {
345345
/**
346346
* Set the new context http header option

src/AbstractStructArrayBase.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function count(): int
5050
* Method returning the current element
5151
* @return mixed
5252
*/
53+
#[\ReturnTypeWillChange]
5354
public function current()
5455
{
5556
$this->initInternArray();
@@ -61,6 +62,7 @@ public function current()
6162
* Method moving the current position to the next element
6263
* @return AbstractStructArrayBase
6364
*/
65+
#[\ReturnTypeWillChange]
6466
public function next(): self
6567
{
6668
$this->initInternArray();
@@ -72,6 +74,7 @@ public function next(): self
7274
* Method resetting itemOffset
7375
* @return AbstractStructArrayBase
7476
*/
77+
#[\ReturnTypeWillChange]
7578
public function rewind(): self
7679
{
7780
$this->initInternArray();
@@ -129,10 +132,10 @@ public function add($item): self
129132
$currentArray = $this->getPropertyValue($this->getAttributeName());
130133
$currentArray[] = $item;
131134
$this
132-
->setPropertyValue($this->getAttributeName(), $currentArray)
133135
->setInternArray($currentArray)
134136
->setInternArrayIsArray(true)
135-
->setInternArrayOffset(0);
137+
->setInternArrayOffset(0)
138+
->setPropertyValue($this->getAttributeName(), $currentArray);
136139

137140
return $this;
138141
}
@@ -176,6 +179,7 @@ public function offsetExists($offset): bool
176179
* @param mixed $offset
177180
* @return mixed
178181
*/
182+
#[\ReturnTypeWillChange]
179183
public function offsetGet($offset)
180184
{
181185
$this->initInternArray();
@@ -189,20 +193,24 @@ public function offsetGet($offset)
189193
* @param mixed $value
190194
* @return AbstractStructArrayBase
191195
*/
196+
#[\ReturnTypeWillChange]
192197
public function offsetSet($offset, $value): self
193198
{
194199
$this->initInternArray();
195200

196201
$this->internArray[$offset] = $value;
197202

198-
return $this->setPropertyValue($this->getAttributeName(), $this->internArray);
203+
$this->setPropertyValue($this->getAttributeName(), $this->internArray);
204+
205+
return $this;
199206
}
200207

201208
/**
202209
* Method unsetting value at offset
203210
* @param mixed $offset
204211
* @return AbstractStructArrayBase
205212
*/
213+
#[\ReturnTypeWillChange]
206214
public function offsetUnset($offset): self
207215
{
208216
$this->initInternArray();

0 commit comments

Comments
 (0)