File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,16 @@ abstract class AbstractConsignment
229
229
*/
230
230
public const LABEL_DESCRIPTION_MAX_LENGTH = 45 ;
231
231
232
+ /**
233
+ * @var int
234
+ */
235
+ public const PERSON_NAME_MAX_LENGTH = 50 ;
236
+
237
+ /**
238
+ * @var int
239
+ */
240
+ public const COMPANY_NAME_MAX_LENGTH = 50 ;
241
+
232
242
/**
233
243
* @internal
234
244
* @var null|string
@@ -1245,7 +1255,7 @@ public function getPerson(): string
1245
1255
*/
1246
1256
public function setPerson (string $ person ): self
1247
1257
{
1248
- $ this ->person = $ person ;
1258
+ $ this ->person = Str:: limit ( $ person, self :: PERSON_NAME_MAX_LENGTH ) ;
1249
1259
1250
1260
return $ this ;
1251
1261
}
@@ -1268,6 +1278,10 @@ public function getCompany(): ?string
1268
1278
*/
1269
1279
public function setCompany (?string $ company ): self
1270
1280
{
1281
+ if (isset ($ company )) {
1282
+ $ company = Str::limit ($ company , self ::COMPANY_NAME_MAX_LENGTH );
1283
+ }
1284
+
1271
1285
$ this ->company = $ company ;
1272
1286
1273
1287
return $ this ;
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ class UPSConsignment extends AbstractConsignment
11
11
{
12
12
public const DEFAULT_WEIGHT = 3000 ;
13
13
14
+ /**
15
+ * @var int
16
+ */
17
+ public const PERSON_NAME_MAX_LENGTH = 35 ;
18
+
14
19
/**
15
20
* @internal
16
21
* @var int
You can’t perform that action at this time.
0 commit comments