Skip to content

Commit

Permalink
Merge branch 'release/5.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelcom committed Aug 10, 2022
2 parents 3575e50 + 0302017 commit 151ffb8
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .php_cs → .php-cs-fixer.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
->exclude('vendor')
->in(__DIR__);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setUsingCache(false)
->setRules(array(
'@PSR2' => true,
Expand All @@ -15,6 +15,6 @@
'no_whitespace_in_blank_line' => true,
'ternary_operator_spaces' => true,
'cast_spaces' => true,
'trailing_comma_in_multiline_array' => true
'trailing_comma_in_multiline' => true
))
->setFinder($finder);
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 5.0.2 - 2022/08/10
- PR #44 - Add #[\ReturnTypeWillChange] to AbstractStructArrayBase

## 5.0.1 - 2021/02/09
- Remove trigger_error calls since this is version 5.0 :)

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

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.

Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"name": "Jacob Dreesen",
"email": "[email protected]",
"role": "Contributor"
},
{
"name": "Karl Pierce",
"email": "[email protected]",
"role": "Contributor"
}
],
"support" : {
Expand All @@ -52,10 +57,12 @@
},
"scripts": {
"test": "vendor/bin/phpunit",
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose"
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose",
"phpstan": "vendor/bin/phpstan analyze src --level=3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.0",
"friendsofphp/php-cs-fixer": "~3.0",
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": "^9"
},
"autoload": {
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
ignoreErrors:
- '#Access to an undefined property SoapClient::\$_stream_context.#'
2 changes: 1 addition & 1 deletion src/AbstractSoapClientBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public function setHttpHeader(string $headerName, $headerValue): bool
* Create context if it does not exist
*/
if ($streamContext === null) {
$state = ($this->getSoapClient()->_stream_context = stream_context_create($options)) ? true : false;
$state = is_resource($this->getSoapClient()->_stream_context = stream_context_create($options));
} else {
/**
* Set the new context http header option
Expand Down
14 changes: 11 additions & 3 deletions src/AbstractStructArrayBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function count(): int
* Method returning the current element
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
$this->initInternArray();
Expand All @@ -61,6 +62,7 @@ public function current()
* Method moving the current position to the next element
* @return AbstractStructArrayBase
*/
#[\ReturnTypeWillChange]
public function next(): self
{
$this->initInternArray();
Expand All @@ -72,6 +74,7 @@ public function next(): self
* Method resetting itemOffset
* @return AbstractStructArrayBase
*/
#[\ReturnTypeWillChange]
public function rewind(): self
{
$this->initInternArray();
Expand Down Expand Up @@ -129,10 +132,10 @@ public function add($item): self
$currentArray = $this->getPropertyValue($this->getAttributeName());
$currentArray[] = $item;
$this
->setPropertyValue($this->getAttributeName(), $currentArray)
->setInternArray($currentArray)
->setInternArrayIsArray(true)
->setInternArrayOffset(0);
->setInternArrayOffset(0)
->setPropertyValue($this->getAttributeName(), $currentArray);

return $this;
}
Expand Down Expand Up @@ -176,6 +179,7 @@ public function offsetExists($offset): bool
* @param mixed $offset
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
$this->initInternArray();
Expand All @@ -189,20 +193,24 @@ public function offsetGet($offset)
* @param mixed $value
* @return AbstractStructArrayBase
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value): self
{
$this->initInternArray();

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

return $this->setPropertyValue($this->getAttributeName(), $this->internArray);
$this->setPropertyValue($this->getAttributeName(), $this->internArray);

return $this;
}

/**
* Method unsetting value at offset
* @param mixed $offset
* @return AbstractStructArrayBase
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset): self
{
$this->initInternArray();
Expand Down

0 comments on commit 151ffb8

Please sign in to comment.