@@ -131,12 +131,12 @@ It defines five methods:
131131
132132#### Usage
133133``` php
134- $item = \Api\StructType\Item::__set_state(array(
134+ $item = \Api\StructType\Item::__set_state([
135135 'id' => 1,
136136 'name' => 'Entity #1',
137137 'label' => 'Entity #1',
138138 '_href' => 'http://www.entity.com',
139- ) );
139+ ] );
140140// $item is now an \Api\StructType\Item object
141141```
142142
@@ -147,87 +147,83 @@ This class is the base class for any ```ArrayType``` class generated by [Package
147147#### Usage
148148As soon as you have an element that is an array of items such as:
149149``` php
150- $items = \Api\ArrayType\Items::__set_state(array(
151- 'items' => array(
152- \Api\StructType\Item::__set_state(array(
150+ $items = \Api\ArrayType\Items::__set_state([
151+ 'items' => [
152+ \Api\StructType\Item::__set_state([
153153 'id' => 1,
154154 'name' => 'Entity #1',
155155 'label' => 'Entity #1',
156156 '_href' => 'http://www.entity-1.com',
157- ),
158- \Api\StructType\Item::__set_state(array(
157+ ] ),
158+ \Api\StructType\Item::__set_state([
159159 'id' => 2,
160160 'name' => 'Entity #2',
161161 'label' => 'Entity #2',
162162 '_href' => 'http://www.entity-2.com',
163- ),
164- \Api\StructType\Item::__set_state(array(
163+ ] ),
164+ \Api\StructType\Item::__set_state([
165165 'id' => 3,
166166 'name' => 'Entity #3',
167167 'label' => 'Entity #3',
168168 '_href' => 'http://www.entity-3.com',
169- ),
170- )
171- ) );
169+ ] ),
170+ ],
171+ ] );
172172// 'items' is the unique property of the object
173173// Its name is returned by the getAttributeName method
174174// defined in the generated \Api\ArrayType\Items class
175175```
176- - ** You MUST call first** ``` initInternArray ``` method on your ArrayType object otherwise you'll get nothing working for the implemented methods:
177- ``` php
178- $items->initInternArray();
179- ```
180- - then you can call ``` count ``` , ``` length ``` methods: gives you the number of items contained by your object
181- - you can iterate through the items:
176+ - ** You can call ``` count ``` , ``` length ``` methods: gives you the number of items contained by your object
177+ - You can iterate through the items:
182178``` php
183179foreach ($items as $item) {
184180 // $items->current() and $item is an \Api\StructType\Item object
185181 // $items->key() is the current index
186182}
187183```
188- - you can get the first item:
184+ - You can get the first item:
189185``` php
190186$items->first();
191187```
192- - you can get the last item:
188+ - You can get the last item:
193189``` php
194190$items->last();
195191```
196- - you can get any item:
192+ - You can get any item:
197193``` php
198194$items->item($index);
199195```
200- - you can add a new item:
196+ - You can add a new item:
201197``` php
202- $items->add(\Api\StructType\Item::__set_state(array(
198+ $items->add(\Api\StructType\Item::__set_state([
203199 'id' => 4,
204200 'name' => 'Entity #4',
205201 'label' => 'Entity #4',
206202 '_href' => 'http://www.entity-4.com',
207- ) ));
203+ ] ));
208204```
209- - you can even reset the items:
205+ - You can even reset the items:
210206``` php
211- $items->initInternArray(array(
212- \Api\StructType\Item::__set_state(array(
207+ $items->initInternArray([
208+ \Api\StructType\Item::__set_state([
213209 'id' => 0,
214210 'name' => 'Entity #0',
215211 'label' => 'Entity #0',
216212 '_href' => 'http://www.entity-0.com',
217- ),
218- \Api\StructType\Item::__set_state(array(
213+ ] ),
214+ \Api\StructType\Item::__set_state([
219215 'id' => 1,
220216 'name' => 'Entity #1',
221217 'label' => 'Entity #1',
222218 '_href' => 'http://www.entity-1.com',
223- ),
224- \Api\StructType\Item::__set_state(array(
219+ ] ),
220+ \Api\StructType\Item::__set_state([
225221 'id' => 2,
226222 'name' => 'Entity #2',
227223 'label' => 'Entity #2',
228224 '_href' => 'http://www.entity-2.com',
229- ),
230- ) );
225+ ] ),
226+ ] );
231227```
232228
233229### AbstractSoapClientBase
@@ -246,7 +242,7 @@ class ApiUpdate extends AbstractSoapClientBase
246242 public function UpdateBulkOrder(\Api\StructType\ApiUpdateBulkOrder $parameters)
247243 {
248244 try {
249- $this->setResult(self:: getSoapClient()->UpdateBulkOrder($parameters));
245+ $this->setResult($this-> getSoapClient()->UpdateBulkOrder($parameters));
250246 return $this->getResult();
251247 } catch (\SoapFault $soapFault) {
252248 $this->saveLastError(__METHOD__, $soapFault);
@@ -258,10 +254,10 @@ class ApiUpdate extends AbstractSoapClientBase
258254You can do:
259255``` php
260256use \WsdlToPhp\PackageBase\AbstractSoapClientBase;
261- $options = array(
257+ $options = [
262258 AbstractSoapClientBase::WSDL_URL => '__WSDL_URL__',
263259 AbstractSoapClientBase::WSDL_CLASSMAP => \Api\ApiClassMap::classMap(),
264- ) ;
260+ ] ;
265261// sets the first instance of SoapClient within AbstractSoapClientBase
266262$update = new \Api\ServiceType\ApiUpdate($options);
267263// resets the SoapClient instance
0 commit comments