1
1
<?php
2
2
3
3
/*
4
- * This file was created by developers working at BitBag
5
- * Do you need more information about us and what we do? Visit our https://bitbag.io website!
6
- * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
7
- */
4
+ * This file has been created by developers from BitBag.
5
+ * Feel free to contact us once you face any issues or want to start
6
+ * You can find more information about us on https://bitbag.io and write us
7
+ * an email on hello@bitbag.io.
8
+ */
8
9
9
10
declare (strict_types=1 );
10
11
@@ -42,7 +43,7 @@ public function __construct(
42
43
RequestStack $ requestStack ,
43
44
FileSystem $ fileSystem ,
44
45
ObjectManager $ shippingExportManager ,
45
- string $ shippingLabelsPath
46
+ string $ shippingLabelsPath,
46
47
) {
47
48
$ this ->webClient = $ webClient ;
48
49
$ this ->requestStack = $ requestStack ;
@@ -60,7 +61,7 @@ public function exportShipment(ResourceControllerEvent $exportShipmentEvent): vo
60
61
$ shippingGateway = $ shippingExport ->getShippingGateway ();
61
62
Assert::notNull ($ shippingGateway );
62
63
63
- if ($ shippingGateway ->getCode () !== self :: DPD_GATEWAY_CODE ) {
64
+ if (self :: DPD_GATEWAY_CODE !== $ shippingGateway ->getCode ()) {
64
65
return ;
65
66
}
66
67
@@ -79,7 +80,7 @@ public function exportShipment(ResourceControllerEvent $exportShipmentEvent): vo
79
80
$ shippingGateway ->getConfigValue ('id ' ),
80
81
$ shippingGateway ->getConfigValue ('login ' ),
81
82
$ shippingGateway ->getConfigValue ('password ' ),
82
- $ shippingGateway ->getConfigValue ('wsdl ' )
83
+ $ shippingGateway ->getConfigValue ('wsdl ' ),
83
84
);
84
85
85
86
$ dpd ->setSender ($ this ->webClient ->getSender ());
@@ -90,8 +91,8 @@ public function exportShipment(ResourceControllerEvent $exportShipmentEvent): vo
90
91
} catch (Exception $ exception ) {
91
92
$ session ->getFlashBag ()->add ('error ' , sprintf (
92
93
'DPD Web Service for #%s order: %s ' ,
93
- $ shipment ->getOrder () !== null ? (string ) $ shipment ->getOrder ()->getNumber () : '' ,
94
- $ exception ->getMessage ()
94
+ null !== $ shipment ->getOrder () ? (string ) $ shipment ->getOrder ()->getNumber () : '' ,
95
+ $ exception ->getMessage (),
95
96
));
96
97
97
98
return ;
@@ -105,7 +106,7 @@ public function exportShipment(ResourceControllerEvent $exportShipmentEvent): vo
105
106
public function saveShippingLabel (
106
107
ShippingExportInterface $ shippingExport ,
107
108
string $ labelContent ,
108
- string $ labelExtension
109
+ string $ labelExtension,
109
110
): void {
110
111
$ labelPath = $ this ->shippingLabelsPath
111
112
. '/ ' . $ this ->getFilename ($ shippingExport )
@@ -135,7 +136,7 @@ private function getFilename(ShippingExportInterface $shippingExport): string
135
136
[
136
137
$ shipmentId ,
137
138
preg_replace ('~[^A-Za-z0-9]~ ' , '' , (string ) $ orderNumber ),
138
- ]
139
+ ],
139
140
);
140
141
}
141
142
0 commit comments