From 1ed11c65dde8b5d60990348ffd9925c7e3910115 Mon Sep 17 00:00:00 2001 From: Jenkins Robot Date: Tue, 7 Feb 2023 23:10:36 +0000 Subject: [PATCH 1/4] Bump version to 107.3.1 --- composer.json | 2 +- src/composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d4efba3..215ca86 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "license": "OSL-3.0", "description": "Automatically attach pdf and terms and conditions documents to outgoing sales emails.", "type": "magento2-module", - "version": "107.3.0", + "version": "107.3.1", "autoload": { "psr-4": { "Fooman\\EmailAttachments\\": "src/" diff --git a/src/composer.json b/src/composer.json index f24c853..41abf0d 100644 --- a/src/composer.json +++ b/src/composer.json @@ -3,7 +3,7 @@ "license": "OSL-3.0", "description": "Automatically attach pdf and terms and conditions documents to outgoing sales emails.", "type": "magento2-module", - "version": "107.3.0", + "version": "107.3.1", "autoload": { "psr-4": { "Fooman\\EmailAttachments\\": "" From c678d2a0dd49effea793c5bdf1ec58fb97f7c664 Mon Sep 17 00:00:00 2001 From: Jenkins Robot Date: Tue, 7 Feb 2023 23:10:36 +0000 Subject: [PATCH 2/4] Progress change log for next release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48cd058..4e81cf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## [Unreleased] + ## [107.3.0] - 2023-02-07 ### Added - Support for Php 8.2 From 99c00a35caec9dd7b1b496a492ddf167ae3d115f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Luki=C4=87?= Date: Sat, 2 Sep 2023 19:03:53 +0200 Subject: [PATCH 3/4] CS fixes --- src/Block/Config/PrintOrderPdf.php | 2 +- src/Model/Api/AttachmentInterface.php | 4 ++-- src/Model/ContentAttacher.php | 8 +++---- .../AbstractSendCreditmemoObserver.php | 4 ++-- src/Observer/AbstractSendInvoiceObserver.php | 4 ++-- .../AbstractSendInvoiceShipmentObserver.php | 2 +- src/Observer/AbstractSendOrderObserver.php | 4 ++-- src/Observer/AbstractSendShipmentObserver.php | 4 ++-- .../BeforeSendCreditmemoCommentObserver.php | 4 ++-- .../BeforeSendInvoiceCommentObserver.php | 4 ++-- ...foreSendInvoiceShipmentCommentObserver.php | 2 +- .../BeforeSendOrderCommentObserver.php | 4 ++-- .../BeforeSendShipmentCommentObserver.php | 4 ++-- src/etc/adminhtml/system.xml | 24 ++++++++++++------- src/etc/di.xml | 6 +++-- 15 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/Block/Config/PrintOrderPdf.php b/src/Block/Config/PrintOrderPdf.php index 14d8652..8709783 100644 --- a/src/Block/Config/PrintOrderPdf.php +++ b/src/Block/Config/PrintOrderPdf.php @@ -11,7 +11,7 @@ */ class PrintOrderPdf extends \Magento\Config\Block\System\Config\Form\Field { - const EXT_URL = 'http://store.fooman.co.nz/extensions/magento2/magento-extension-print-order-pdf-m2.html'; + public const EXT_URL = 'http://store.fooman.co.nz/extensions/magento2/magento-extension-print-order-pdf-m2.html'; protected $moduleList; diff --git a/src/Model/Api/AttachmentInterface.php b/src/Model/Api/AttachmentInterface.php index ab079a3..3d599eb 100644 --- a/src/Model/Api/AttachmentInterface.php +++ b/src/Model/Api/AttachmentInterface.php @@ -11,8 +11,8 @@ */ interface AttachmentInterface { - const ENCODING_BASE64 = 'base64'; - const DISPOSITION_ATTACHMENT = 'attachment'; + public const ENCODING_BASE64 = 'base64'; + public const DISPOSITION_ATTACHMENT = 'attachment'; public function getMimeType(); diff --git a/src/Model/ContentAttacher.php b/src/Model/ContentAttacher.php index 27ba5a1..c29b9ed 100644 --- a/src/Model/ContentAttacher.php +++ b/src/Model/ContentAttacher.php @@ -13,10 +13,10 @@ */ class ContentAttacher { - const MIME_PDF = 'application/pdf'; - const TYPE_OCTETSTREAM = 'application/octet-stream'; - const MIME_TXT = 'text/plain'; - const MIME_HTML = 'text/html'; + public const MIME_PDF = 'application/pdf'; + public const TYPE_OCTETSTREAM = 'application/octet-stream'; + public const MIME_TXT = 'text/plain'; + public const MIME_HTML = 'text/html'; private $attachmentFactory; diff --git a/src/Observer/AbstractSendCreditmemoObserver.php b/src/Observer/AbstractSendCreditmemoObserver.php index 97ea300..da93293 100644 --- a/src/Observer/AbstractSendCreditmemoObserver.php +++ b/src/Observer/AbstractSendCreditmemoObserver.php @@ -11,8 +11,8 @@ */ class AbstractSendCreditmemoObserver extends AbstractObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/creditmemo/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/creditmemo/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/creditmemo/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/creditmemo/attachagreement'; public function execute(\Magento\Framework\Event\Observer $observer) { diff --git a/src/Observer/AbstractSendInvoiceObserver.php b/src/Observer/AbstractSendInvoiceObserver.php index fd74c0c..1b91f39 100644 --- a/src/Observer/AbstractSendInvoiceObserver.php +++ b/src/Observer/AbstractSendInvoiceObserver.php @@ -11,8 +11,8 @@ */ class AbstractSendInvoiceObserver extends AbstractObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/invoice/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/invoice/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/invoice/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/invoice/attachagreement'; public function execute(\Magento\Framework\Event\Observer $observer) { diff --git a/src/Observer/AbstractSendInvoiceShipmentObserver.php b/src/Observer/AbstractSendInvoiceShipmentObserver.php index 3de9d33..6867ae4 100644 --- a/src/Observer/AbstractSendInvoiceShipmentObserver.php +++ b/src/Observer/AbstractSendInvoiceShipmentObserver.php @@ -11,7 +11,7 @@ */ class AbstractSendInvoiceShipmentObserver extends AbstractObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/shipment/attachinvoicepdf'; + public const XML_PATH_ATTACH_PDF = 'sales_email/shipment/attachinvoicepdf'; public function execute(\Magento\Framework\Event\Observer $observer) { diff --git a/src/Observer/AbstractSendOrderObserver.php b/src/Observer/AbstractSendOrderObserver.php index b50f289..b11c424 100644 --- a/src/Observer/AbstractSendOrderObserver.php +++ b/src/Observer/AbstractSendOrderObserver.php @@ -11,8 +11,8 @@ */ class AbstractSendOrderObserver extends AbstractObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/order/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/order/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/order/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/order/attachagreement'; public function execute(\Magento\Framework\Event\Observer $observer) { diff --git a/src/Observer/AbstractSendShipmentObserver.php b/src/Observer/AbstractSendShipmentObserver.php index f17a098..c788703 100644 --- a/src/Observer/AbstractSendShipmentObserver.php +++ b/src/Observer/AbstractSendShipmentObserver.php @@ -11,8 +11,8 @@ */ class AbstractSendShipmentObserver extends AbstractObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/shipment/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/shipment/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/shipment/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/shipment/attachagreement'; public function execute(\Magento\Framework\Event\Observer $observer) { diff --git a/src/Observer/BeforeSendCreditmemoCommentObserver.php b/src/Observer/BeforeSendCreditmemoCommentObserver.php index 7a432eb..a45442b 100644 --- a/src/Observer/BeforeSendCreditmemoCommentObserver.php +++ b/src/Observer/BeforeSendCreditmemoCommentObserver.php @@ -11,6 +11,6 @@ */ class BeforeSendCreditmemoCommentObserver extends AbstractSendCreditmemoObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/creditmemo_comment/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/creditmemo_comment/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/creditmemo_comment/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/creditmemo_comment/attachagreement'; } diff --git a/src/Observer/BeforeSendInvoiceCommentObserver.php b/src/Observer/BeforeSendInvoiceCommentObserver.php index ba265e0..a163e3e 100644 --- a/src/Observer/BeforeSendInvoiceCommentObserver.php +++ b/src/Observer/BeforeSendInvoiceCommentObserver.php @@ -11,6 +11,6 @@ */ class BeforeSendInvoiceCommentObserver extends AbstractSendInvoiceObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/invoice_comment/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/invoice_comment/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/invoice_comment/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/invoice_comment/attachagreement'; } diff --git a/src/Observer/BeforeSendInvoiceShipmentCommentObserver.php b/src/Observer/BeforeSendInvoiceShipmentCommentObserver.php index 4ed5315..3904967 100644 --- a/src/Observer/BeforeSendInvoiceShipmentCommentObserver.php +++ b/src/Observer/BeforeSendInvoiceShipmentCommentObserver.php @@ -11,5 +11,5 @@ */ class BeforeSendInvoiceShipmentCommentObserver extends AbstractSendInvoiceShipmentObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/shipment_comment/attachinvoicepdf'; + public const XML_PATH_ATTACH_PDF = 'sales_email/shipment_comment/attachinvoicepdf'; } diff --git a/src/Observer/BeforeSendOrderCommentObserver.php b/src/Observer/BeforeSendOrderCommentObserver.php index cdabb66..f68c56b 100644 --- a/src/Observer/BeforeSendOrderCommentObserver.php +++ b/src/Observer/BeforeSendOrderCommentObserver.php @@ -11,6 +11,6 @@ */ class BeforeSendOrderCommentObserver extends AbstractSendOrderObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/order_comment/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/order_comment/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/order_comment/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/order_comment/attachagreement'; } diff --git a/src/Observer/BeforeSendShipmentCommentObserver.php b/src/Observer/BeforeSendShipmentCommentObserver.php index b505890..e4071ec 100644 --- a/src/Observer/BeforeSendShipmentCommentObserver.php +++ b/src/Observer/BeforeSendShipmentCommentObserver.php @@ -11,6 +11,6 @@ */ class BeforeSendShipmentCommentObserver extends AbstractSendShipmentObserver { - const XML_PATH_ATTACH_PDF = 'sales_email/shipment_comment/attachpdf'; - const XML_PATH_ATTACH_AGREEMENT = 'sales_email/shipment_comment/attachagreement'; + public const XML_PATH_ATTACH_PDF = 'sales_email/shipment_comment/attachpdf'; + public const XML_PATH_ATTACH_AGREEMENT = 'sales_email/shipment_comment/attachagreement'; } diff --git a/src/etc/adminhtml/system.xml b/src/etc/adminhtml/system.xml index 7fa9fa2..80f747e 100644 --- a/src/etc/adminhtml/system.xml +++ b/src/etc/adminhtml/system.xml @@ -37,7 +37,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> @@ -64,7 +65,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> @@ -90,7 +92,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> @@ -116,7 +119,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> @@ -154,7 +158,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> @@ -192,7 +197,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> @@ -218,7 +224,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> @@ -244,7 +251,8 @@ Magento\Config\Model\Config\Source\Yesno Stores > Terms and Conditions) will be automatically attached to the email.]]> + (from Stores > Terms and Conditions) + will be automatically attached to the email.]]> diff --git a/src/etc/di.xml b/src/etc/di.xml index 7d8859d..c559df9 100644 --- a/src/etc/di.xml +++ b/src/etc/di.xml @@ -17,7 +17,8 @@ - + @@ -59,7 +60,8 @@ - + \Magento\Sales\Model\Order\Pdf\Creditmemo From 6bff94cc8b6c9aa80d88211ea5e609bb2d4d8cb7 Mon Sep 17 00:00:00 2001 From: "Kristof Ringleff, Fooman" Date: Mon, 18 Mar 2024 13:59:59 +1300 Subject: [PATCH 4/4] work with php 8.3, bump version to 107.4.0 --- CHANGELOG.md | 4 ++++ captainhook.json | 4 ++-- composer.json | 19 ++++++++----------- src/Model/TermsAndConditionsAttacher.php | 2 +- src/composer.json | 8 ++++---- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e81cf9..7b577dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log ## [Unreleased] +### Added +- Support for Php 8.3 +### Changed +- Code style updates for newer Magento Coding Standard ## [107.3.0] - 2023-02-07 ### Added diff --git a/captainhook.json b/captainhook.json index f95c2ea..c4f99f3 100644 --- a/captainhook.json +++ b/captainhook.json @@ -26,12 +26,12 @@ "conditions": [] }, { - "action": "vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../phpcompatibility/php-compatibility && vendor/bin/phpcs --severity=7 -s --standard=Magento2 src", + "action": "vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../magento/php-compatibility-fork,../../phpcsstandards/phpcsutils && vendor/bin/phpcs --severity=6 -s --standard=Magento2 src", "options": [], "conditions": [] }, { - "action": "vendor/bin/phpstan analyse src/ -l 4", + "action": "vendor/bin/phpstan analyse src/ -l 5", "options": [], "conditions": [] } diff --git a/composer.json b/composer.json index 215ca86..025315c 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "license": "OSL-3.0", "description": "Automatically attach pdf and terms and conditions documents to outgoing sales emails.", "type": "magento2-module", - "version": "107.3.1", + "version": "107.4.0", "autoload": { "psr-4": { "Fooman\\EmailAttachments\\": "src/" @@ -13,27 +13,24 @@ ] }, "require": { - "php": "~7.1.0||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0||~8.2.0", + "php": "~7.1.0||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0||~8.2.0||~8.3.0", + "laminas/laminas-mime": "^2.5", "magento/framework": "^102.0.5 || ^103.0.0", "magento/module-backend": "^101.0.0 || ^102.0.0", - "magento/module-sales": "^102.0.0 || ^103.0.0", "magento/module-checkout-agreements": "^100.0.2", "magento/module-email": "^101.0.3", - "laminas/laminas-mime": "^2.5" + "magento/module-sales": "^102.0.0 || ^103.0.0" }, "require-dev": { "fooman/testing-and-quality-tools": "^1.0" }, - "repositories": [ - { - "type": "composer", - "url": "https://repo-magento-mirror.fooman.co.nz/" - } - ], "minimum-stability": "dev", "prefer-stable": true, "suggest": { "fooman/printorderpdf-m2": "Allows attaching the order confirmation pdf to the order confirmation email", "fooman/pdfcustomiser-m2": "Allows to easily customise the sales pdfs while also reducing file sizes " + }, + "config": { + "sort-packages": true } -} \ No newline at end of file +} diff --git a/src/Model/TermsAndConditionsAttacher.php b/src/Model/TermsAndConditionsAttacher.php index 4a363ff..4470c16 100644 --- a/src/Model/TermsAndConditionsAttacher.php +++ b/src/Model/TermsAndConditionsAttacher.php @@ -32,7 +32,7 @@ public function attachForStore($storeId, ContainerInterface $attachmentContainer * @var \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Collection $agreements */ $agreements = $this->termsCollection->create(); - $agreements->addStoreFilter($storeId)->addFieldToFilter('is_active', 1); + $agreements->addStoreFilter($storeId)->addFieldToFilter('is_active', "1"); foreach ($agreements as $agreement) { $this->attachAgreement($agreement, $attachmentContainer); diff --git a/src/composer.json b/src/composer.json index 41abf0d..b9be47b 100644 --- a/src/composer.json +++ b/src/composer.json @@ -3,7 +3,7 @@ "license": "OSL-3.0", "description": "Automatically attach pdf and terms and conditions documents to outgoing sales emails.", "type": "magento2-module", - "version": "107.3.1", + "version": "107.4.0", "autoload": { "psr-4": { "Fooman\\EmailAttachments\\": "" @@ -13,13 +13,13 @@ ] }, "require": { - "php": "~7.1.0||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0||~8.2.0", + "php": "~7.1.0||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0||~8.2.0||~8.3.0", + "laminas/laminas-mime": "^2.5", "magento/framework": "^102.0.5 || ^103.0.0", "magento/module-backend": "^101.0.0 || ^102.0.0", - "magento/module-sales": "^102.0.0 || ^103.0.0", "magento/module-checkout-agreements": "^100.0.2", "magento/module-email": "^101.0.3", - "laminas/laminas-mime": "^2.5" + "magento/module-sales": "^102.0.0 || ^103.0.0" }, "minimum-stability": "dev", "prefer-stable": true,