From 134b2161787e3b79dda84bf712084adf6c70af43 Mon Sep 17 00:00:00 2001 From: Manuel Reinhard Date: Wed, 12 Feb 2025 12:03:05 +0100 Subject: [PATCH] Mark CombinedAddress as deprecated and remove it from examples --- example/example.php | 11 +++++------ example/example_minimal.php | 8 +++++--- example/example_scor.php | 11 +++++------ example/example_zero_amount.php | 8 +++++--- src/DataGroup/Element/CombinedAddress.php | 5 +++++ 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/example/example.php b/example/example.php index ef52d2e5..ac1da103 100644 --- a/example/example.php +++ b/example/example.php @@ -19,10 +19,12 @@ // Add creditor information // Who will receive the payment and to which bank account? $qrBill->setCreditor( - QrBill\DataGroup\Element\CombinedAddress::create( + QrBill\DataGroup\Element\StructuredAddress::createWithStreet( 'Robert Schneider AG', - 'Rue du Lac 1268', - '2501 Biel', + 'Rue du Lac', + '1268', + '2501', + 'Biel', 'CH' ) ); @@ -35,9 +37,6 @@ // Add debtor information // Who has to pay the invoice? This part is optional. -// -// Note how you can use two different styles of addresses: CombinedAddress or StructuredAddress. -// They are interchangeable for creditor as well as debtor. $qrBill->setUltimateDebtor( QrBill\DataGroup\Element\StructuredAddress::createWithStreet( 'Pia-Maria Rutschmann-Schnyder', diff --git a/example/example_minimal.php b/example/example_minimal.php index 26adea26..80cc0eb8 100644 --- a/example/example_minimal.php +++ b/example/example_minimal.php @@ -15,10 +15,12 @@ // Add creditor information // Who will receive the payment and to which bank account? $qrBill->setCreditor( - QrBill\DataGroup\Element\CombinedAddress::create( + QrBill\DataGroup\Element\StructuredAddress::createWithStreet( 'Robert Schneider AG', - 'Rue du Lac 1268', - '2501 Biel', + 'Rue du Lac', + '1268', + '2501', + 'Biel', 'CH' ) ); diff --git a/example/example_scor.php b/example/example_scor.php index 36ea4129..3d21df5d 100644 --- a/example/example_scor.php +++ b/example/example_scor.php @@ -12,10 +12,12 @@ // Add creditor information // Who will receive the payment and to which bank account? $qrBill->setCreditor( - QrBill\DataGroup\Element\CombinedAddress::create( + QrBill\DataGroup\Element\StructuredAddress::createWithStreet( 'Robert Schneider AG', - 'Rue du Lac 1268', - '2501 Biel', + 'Rue du Lac', + '1268', + '2501', + 'Biel', 'CH' ) ); @@ -28,9 +30,6 @@ // Add debtor information // Who has to pay the invoice? This part is optional. -// -// Notice how you can use two different styles of addresses: CombinedAddress or StructuredAddress. -// They are interchangeable for creditor as well as debtor. $qrBill->setUltimateDebtor( QrBill\DataGroup\Element\StructuredAddress::createWithStreet( 'Pia-Maria Rutschmann-Schnyder', diff --git a/example/example_zero_amount.php b/example/example_zero_amount.php index 3a560dce..529b4fd2 100644 --- a/example/example_zero_amount.php +++ b/example/example_zero_amount.php @@ -16,10 +16,12 @@ // Add creditor information $qrBill->setCreditor( - QrBill\DataGroup\Element\CombinedAddress::create( + QrBill\DataGroup\Element\StructuredAddress::createWithStreet( 'Robert Schneider AG', - 'Rue du Lac 1268', - '2501 Biel', + 'Rue du Lac', + '1268', + '2501', + 'Biel', 'CH' ) ); diff --git a/src/DataGroup/Element/CombinedAddress.php b/src/DataGroup/Element/CombinedAddress.php index 67a13484..dbe63ce0 100644 --- a/src/DataGroup/Element/CombinedAddress.php +++ b/src/DataGroup/Element/CombinedAddress.php @@ -10,6 +10,11 @@ use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Mapping\ClassMetadata; +/** + * @deprecated The CombinedAdress is no longer supported by v2.3 of the QR bill specifications, valid from 21 November 2025. + * This class will be removed in a future major version of this library. Use StructuredAddress instead. + * For UltimateDebtor, you can also choose to set no data at all. + */ class CombinedAddress extends Address implements AddressInterface, SelfValidatableInterface, QrCodeableInterface { use SelfValidatableTrait;