Skip to content

Commit cfaa4df

Browse files
committed
Add unlisted PUDO types
1 parent 61e8b40 commit cfaa4df

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

src/Enum/Type.php

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88

99
class Type extends Enum
1010
{
11-
public const STANDARD = 100;
12-
public const CHAIN = 200;
13-
public const DPD = 300;
11+
public const STANDARD = '100';
12+
public const CHAIN = '200';
13+
public const DPD = '300';
14+
public const SWIP_BOX_1 = '400401';
15+
public const SWIP_BOX_2 = '400402';
16+
public const POINT_PACK = '500501';
17+
public const FOREIGN_LOCKER = '400';
1418

1519
public static function standard(): self
1620
{
@@ -26,4 +30,24 @@ public static function dpd(): self
2630
{
2731
return self::get(self::DPD);
2832
}
33+
34+
public static function swipBox1(): self
35+
{
36+
return self::get(self::SWIP_BOX_1);
37+
}
38+
39+
public static function swipBox2(): self
40+
{
41+
return self::get(self::SWIP_BOX_2);
42+
}
43+
44+
public static function pointPack(): self
45+
{
46+
return self::get(self::POINT_PACK);
47+
}
48+
49+
public static function foreignLocker(): self
50+
{
51+
return self::get(self::FOREIGN_LOCKER);
52+
}
2953
}

src/Service/PUDOFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function fromXmlElement(\SimpleXMLElement $xml): PUDO
2222
$pudo = new PUDO();
2323
$pudo->active = 'true' === (string) $xml['active'];
2424
$pudo->id = (string) $xml->PUDO_ID;
25-
$pudo->type = Type::byValue((int) $xml->PUDO_TYPE);
25+
$pudo->type = Type::byValue((string) $xml->PUDO_TYPE);
2626
$pudo->language = (string) $xml->LANGUAGE;
2727
$pudo->address = $this->createAddress($xml);
2828
$pudo->coordinates = new Coordinates((float) $xml->LATITUDE, (float) $xml->LONGITUDE);

0 commit comments

Comments
 (0)