Skip to content

Commit 51536e2

Browse files
r-brownCopilot
andauthored
Update service/LicenseService.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b3a7259 commit 51536e2

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

service/LicenseService.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,39 @@ class LicenseService
4343
* @throws MalformedArgumentsException
4444
* @throws RestException
4545
*/
46-
public static function create(Context $context, string $licenseeNumber, string $licenseTemplateNumber, License $license, ?string $transactionNumber = null): ?License
46+
/**
47+
* @deprecated since version X.X. Use createWithTransaction() with the new parameter order instead.
48+
*
49+
* Creates new license object with given properties.
50+
*
51+
* @param Context $context
52+
* @param string $licenseeNumber
53+
* @param string $licenseTemplateNumber
54+
* @param null|string $transactionNumber
55+
* @param License $license
56+
* @return License|null
57+
* @throws MalformedArgumentsException
58+
* @throws RestException
59+
*/
60+
public static function create(Context $context, string $licenseeNumber, string $licenseTemplateNumber, ?string $transactionNumber, License $license): ?License
61+
{
62+
// Call the new method with the correct parameter order
63+
return self::createWithTransaction($context, $licenseeNumber, $licenseTemplateNumber, $license, $transactionNumber);
64+
}
65+
66+
/**
67+
* Creates new license object with given properties. Preferred method.
68+
*
69+
* @param Context $context
70+
* @param string $licenseeNumber
71+
* @param string $licenseTemplateNumber
72+
* @param License $license
73+
* @param null|string $transactionNumber
74+
* @return License|null
75+
* @throws MalformedArgumentsException
76+
* @throws RestException
77+
*/
78+
public static function createWithTransaction(Context $context, string $licenseeNumber, string $licenseTemplateNumber, License $license, ?string $transactionNumber = null): ?License
4779
{
4880
CheckUtils::paramNotEmpty($licenseeNumber, Constants::LICENSEE_NUMBER);
4981
CheckUtils::paramNotEmpty($licenseTemplateNumber, Constants::LICENSE_TEMPLATE_NUMBER);

0 commit comments

Comments
 (0)