Skip to content

Commit bafbaea

Browse files
committed
Update doc examples
1 parent da7cee0 commit bafbaea

File tree

1 file changed

+53
-44
lines changed

1 file changed

+53
-44
lines changed

docs/services.rst

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ Gets the current status by Barcode
316316
.. code-block:: php
317317
318318
<?php
319-
$this->getClient()->getCurrentStatus((new CurrentStatus())
319+
$postnl = new PostNL(...);
320+
$postnl->getCurrentStatus((new CurrentStatus())
320321
->setShipment(
321322
(new Shipment())
322323
->setBarcode('3SDEVC98237423')
@@ -337,7 +338,8 @@ Gets the current status by reference. Note that you must have set the reference
337338
.. code-block:: php
338339
339340
<?php
340-
$this->getClient()->getCurrentStatusByReference((new CurrentStatusByReference())
341+
$postnl = new PostNL(...);
342+
$postnl->getCurrentStatusByReference((new CurrentStatusByReference())
341343
->setShipment(
342344
(new Shipment())
343345
->setReference('myref')
@@ -357,12 +359,13 @@ Gets the current status by status.
357359
.. code-block:: php
358360
359361
<?php
360-
$this->getClient()->getCurrentStatusByStatus((new CurrentStatusByStatus())
361-
->setShipment(
362-
(new Shipment())
363-
->setStatusCode('5')
364-
)
365-
);
362+
$postnl = new PostNL(...);
363+
$postnl->getCurrentStatusByStatus((new CurrentStatusByStatus())
364+
->setShipment(
365+
(new Shipment())
366+
->setStatusCode('5')
367+
)
368+
);
366369
367370
statusrequest
368371
``CurrentStatusByStatus`` - `required`
@@ -377,14 +380,15 @@ Gets the current status by phase code. Note that the date range is required.
377380
.. code-block:: php
378381
379382
<?php
380-
$this->getClient()->getCurrentStatusByReference((new CurrentStatusByPhase())
381-
->setShipment(
382-
(new Shipment())
383-
->setPhaseCode('5')
384-
->setDateFrom(date('d-m-Y H:i:s', strtotime('-7 days'))
385-
->setDateTo(date('d-m-Y H:i:s')
386-
)
387-
);
383+
$postnl = new PostNL(...);
384+
$postnl->getCurrentStatusByReference((new CurrentStatusByPhase())
385+
->setShipment(
386+
(new Shipment())
387+
->setPhaseCode('5')
388+
->setDateFrom(date('d-m-Y H:i:s', strtotime('-7 days'))
389+
->setDateTo(date('d-m-Y H:i:s')
390+
)
391+
);
388392
389393
statusrequest
390394
``CurrentStatusByPhase`` - `required`
@@ -399,12 +403,13 @@ Gets the complete status by Barcode
399403
.. code-block:: php
400404
401405
<?php
402-
$this->getClient()->getCompleteStatus((new CompleteStatus())
403-
->setShipment(
404-
(new Shipment())
405-
->setBarcode('3SDEVC98237423')
406-
)
407-
);
406+
$postnl = new PostNL(...);
407+
$postnl->getCompleteStatus((new CompleteStatus())
408+
->setShipment(
409+
(new Shipment())
410+
->setBarcode('3SDEVC98237423')
411+
)
412+
);
408413
409414
statusrequest
410415
``CompleteStatus`` - `required`
@@ -419,12 +424,13 @@ Gets the complete status by reference. Note that you must have set the reference
419424
.. code-block:: php
420425
421426
<?php
422-
$this->getClient()->getCompleteStatusByReference((new CompleteStatusByReference())
423-
->setShipment(
424-
(new Shipment())
425-
->setReference('myref')
426-
)
427-
);
427+
$postnl = new PostNL(...);
428+
$postnl->getCompleteStatusByReference((new CompleteStatusByReference())
429+
->setShipment(
430+
(new Shipment())
431+
->setReference('myref')
432+
)
433+
);
428434
429435
statusrequest
430436
``CompleteStatusByReference`` - `required`
@@ -439,12 +445,13 @@ Gets the complete status by status.
439445
.. code-block:: php
440446
441447
<?php
442-
$this->getClient()->getCompleteStatusByStatus((new CompleteStatusByStatus())
443-
->setShipment(
444-
(new Shipment())
445-
->setStatusCode('5')
446-
)
447-
);
448+
$postnl = new PostNL(...);
449+
$postnl->getCompleteStatusByStatus((new CompleteStatusByStatus())
450+
->setShipment(
451+
(new Shipment())
452+
->setStatusCode('5')
453+
)
454+
);
448455
449456
statusrequest
450457
``CompleteStatusByStatus`` - `required`
@@ -459,14 +466,15 @@ Gets the complete status by phase code. Note that the date range is required.
459466
.. code-block:: php
460467
461468
<?php
462-
$this->getClient()->getCompleteStatusByReference((new CompleteStatusByPhase())
463-
->setShipment(
464-
(new Shipment())
465-
->setPhaseCode('5')
466-
->setDateFrom(date('d-m-Y H:i:s', strtotime('-7 days'))
467-
->setDateTo(date('d-m-Y H:i:s')
468-
)
469-
);
469+
$postnl = new PostNL(...);
470+
$postnl->getCompleteStatusByReference((new CompleteStatusByPhase())
471+
->setShipment(
472+
(new Shipment())
473+
->setPhaseCode('5')
474+
->setDateFrom(date('d-m-Y H:i:s', strtotime('-7 days'))
475+
->setDateTo(date('d-m-Y H:i:s')
476+
)
477+
);
470478
471479
statusrequest
472480
``CompleteStatusByPhase`` - `required`
@@ -479,8 +487,9 @@ Get Signature
479487
Gets the signature of the shipment when available. A signature can be accessed by barcode only.
480488

481489
.. code-block:: php
482-
483-
$this->getClient()->getSignature(
490+
<?php
491+
$postnl = new PostNL(...);
492+
$postnl->getSignature(
484493
(new GetSignature())
485494
->setShipment((new Shipment)
486495
->setBarcode('3SDEVC23987423')

0 commit comments

Comments
 (0)