Skip to content

Commit 854ab0f

Browse files
committed
Merge branch 'release/1.0.1'
2 parents 8dd9e79 + e234172 commit 854ab0f

File tree

5 files changed

+27
-29
lines changed

5 files changed

+27
-29
lines changed

CHANGELOG.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
1-
CHANGELOG
2-
=========
1+
# CHANGELOG
32

4-
1.0.0
5-
---------
3+
## 1.0.1
4+
- Interfaces' methods has been well declared as public
5+
- Minor readme typo updates
6+
7+
## 1.0.0
68
- First major release, code coverage improved to reach 100% from the 1.0.0RC02 release.
79

8-
1.0.0RC02
9-
---------
10+
## 1.0.0RC02
1011
- Major: update source code structure, put all classes under ```src``` folder, rename Tests to tests, update composer and phpunit accordingly
1112

12-
1.0.0RC01
13-
---------
13+
## 1.0.0RC01
1414
- Update Readme
1515
- Define interfaces that must be used as interfaces in order to be able to define a usable top class for any generated ServiceType/StructType/ArrayType class by the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator)
1616

17-
0.0.3
18-
-----
17+
## 0.0.3
1918
- Update dependency badge
2019

21-
0.0.2
22-
-----
20+
## 0.0.2
2321
- use top level namespace for SoapHeader class
2422

25-
0.0.1
26-
-----
23+
## 0.0.1
2724
- Initial version

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/badges/quality-score.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/)
55
[![Code Coverage](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/badges/coverage.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/)
66
[![Dependency Status](https://www.versioneye.com/user/projects/55b10586643533001c00010f/badge.svg)](https://www.versioneye.com/user/projects/55b10586643533001c00010f)
7+
[![StyleCI](https://styleci.io/repos/38760239/shield)](https://styleci.io/repos/38760239)
78

89
## Main features
910
This project contains base classes used as parent class by the generated classes from [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator):
@@ -31,7 +32,7 @@ There is at least/most one method that must be implemented so it's pretty fast t
3132

3233
### StructArrayInterface
3334
#### Description
34-
This interface must be used to define a new ArrayType class. The goal is to provide utility methods around Array Structs defined by the Wsdl in order to ease the handling of its content. Therefore, this interface inherits from our [StructInterface](structinterface) interface interface plus the native [ArrayAccess](http://php.net/manual/en/class.arrayaccess.php), [Iterator](http://php.net/manual/en/class.iterator.php) and [Countable](http://php.net/manual/en/class.countable.php) PHP interfaces
35+
This interface must be used to define a new ArrayType class. The goal is to provide utility methods around Array Structs defined by the Wsdl in order to ease the handling of its content. Therefore, this interface inherits from our [StructInterface](#structinterface) interface interface plus the native [ArrayAccess](http://php.net/manual/en/class.arrayaccess.php), [Iterator](http://php.net/manual/en/class.iterator.php) and [Countable](http://php.net/manual/en/class.countable.php) PHP interfaces
3536

3637
#### What has to be implemented?
3738
The only method that must implement would be **getAttributeName** but be aware that it is implemented in every generated ArrayType class so no need to define it. It's just a reminder of what is available in ArrayType classes.
@@ -85,10 +86,10 @@ Here are the methods that must be implemented and why:
8586

8687
**If you do not want to implement all these methods, you can too create your own class that inherits from our [AbstractSoapClientBase](#abstractsoapclientbase) class.**
8788

88-
## How tos
89+
## The abstract classes
8990
### AbstractStructBase
9091
#### Description
91-
This class is the base class for any ```StructType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator). It implements our [StructInteface](#structinteface) interface.
92+
This class is the base class for any ```StructType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator). It implements our [StructInterface](#structinterface) interface.
9293
It defines three methods:
9394
- **__set_state($array)**: Useful when you load the string representation of an object that you stored using ```var_export```. It also allows you to ease the instanciation of an object that contains many properties which would be hard to instanciate using the ```__construct``` method. You can see ```__set_state``` as an hydratation method.
9495
- **_set($name, $value)**: As magic method ```__set``` but used by the ```__set_state``` method. Plus, defining ```__set``` method on used class by the classmap option for the [SoapClient](http://php.net/manual/en/class.soapclient.php) breaks the correct hydratation of your received objects.
@@ -107,7 +108,7 @@ $item = \Api\StructType\Item::__set_state(array(
107108

108109
### AbstractStructArrayBase
109110
#### Description
110-
This class is the base class for any ```ArrayType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator). It implements our [StructArrayInteface](#structarrayinterface) interface.
111+
This class is the base class for any ```ArrayType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator). It implements our [StructArrayInterface](#structarrayinterface) interface.
111112

112113
#### Usage
113114
As soon as you have an element that is an array of items such as:
@@ -205,7 +206,7 @@ It's basically a decorator design pattern as the class has the [SoapClient](http
205206
Let's say you have this type of generate ```ServiceType``` class:
206207
```php
207208
namespace Api\ServiceType;
208-
use \WsdlToPhp\PackageBase\AbstractSoapClientBase
209+
use \WsdlToPhp\PackageBase\AbstractSoapClientBase;
209210
class ApiUpdate extends AbstractSoapClientBase
210211
{
211212
public function UpdateBulkOrder(\Api\StructType\ApiUpdateBulkOrder $parameters)
@@ -275,4 +276,4 @@ You can run the unit tests with the following command:
275276
$ cd /path/to/src/WsdlToPhp/PackageBase/
276277
$ composer install
277278
$ phpunit
278-
```
279+
```

src/SoapClientInterface.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ interface SoapClientInterface
139139
* @param array $wsdlOptions
140140
* @param bool $resetSoapClient allows to disable the SoapClient redefinition
141141
*/
142-
function __construct(array $wsdlOptions = array(), $resetSoapClient = true);
142+
public function __construct(array $wsdlOptions = array(), $resetSoapClient = true);
143143
/**
144144
* Static method getting current SoapClient
145145
* @return \SoapClient
146146
*/
147-
static function getSoapClient();
147+
public static function getSoapClient();
148148
/**
149149
* Sets a SoapHeader to send
150150
* For more information, please read the online documentation on {@link http://www.php.net/manual/en/class.soapheader.php}
@@ -155,28 +155,28 @@ static function getSoapClient();
155155
* @param string $actor
156156
* @return SoapClientInterface
157157
*/
158-
function setSoapHeader($nameSpace, $name, $data, $mustUnderstand = false, $actor = null);
158+
public function setSoapHeader($nameSpace, $name, $data, $mustUnderstand = false, $actor = null);
159159
/**
160160
* Method returning last errors occured during the calls
161161
* @return array
162162
*/
163-
function getLastError();
163+
public function getLastError();
164164
/**
165165
* Method saving the last error returned by the SoapClient
166166
* @param string $methoName the method called when the error occurred
167167
* @param \SoapFault $soapFault l'objet de l'erreur
168168
* @return SoapClientInterface
169169
*/
170-
function saveLastError($methoName, \SoapFault $soapFault);
170+
public function saveLastError($methoName, \SoapFault $soapFault);
171171
/**
172172
* Method returning current result from Soap call
173173
* @return mixed
174174
*/
175-
function getResult();
175+
public function getResult();
176176
/**
177177
* Method setting current result from Soap call
178178
* @param mixed $result
179179
* @return SoapClientInterface
180180
*/
181-
function setResult($result);
181+
public function setResult($result);
182182
}

src/StructArrayInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ interface StructArrayInterface extends StructInterface, \ArrayAccess, \Iterator,
99
* This method has been overridden in real-array struct class
1010
* @return string
1111
*/
12-
function getAttributeName();
12+
public function getAttributeName();
1313
}

src/StructInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ interface StructInterface
1111
* @param array $array the exported values
1212
* @return Struct
1313
*/
14-
static function __set_state(array $array);
14+
public static function __set_state(array $array);
1515
}

0 commit comments

Comments
 (0)