Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
fooman committed Mar 18, 2024
2 parents 230f7ae + 6bff94c commit 7898633
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 47 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 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
- Support for Php 8.2
Expand Down
4 changes: 2 additions & 2 deletions captainhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.0",
"autoload": {
"psr-4": {
"Fooman\\EmailAttachments\\": "src/"
Expand All @@ -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"
},
"require-dev": {
"fooman/testing-and-quality-tools": "^1.0"
Expand All @@ -29,5 +29,8 @@
"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
}
}
}
2 changes: 1 addition & 1 deletion src/Block/Config/PrintOrderPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/Model/Api/AttachmentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
8 changes: 4 additions & 4 deletions src/Model/ContentAttacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/TermsAndConditionsAttacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Observer/AbstractSendCreditmemoObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Observer/AbstractSendInvoiceObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Observer/AbstractSendInvoiceShipmentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Observer/AbstractSendOrderObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Observer/AbstractSendShipmentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Observer/BeforeSendCreditmemoCommentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
4 changes: 2 additions & 2 deletions src/Observer/BeforeSendInvoiceCommentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
2 changes: 1 addition & 1 deletion src/Observer/BeforeSendInvoiceShipmentCommentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
4 changes: 2 additions & 2 deletions src/Observer/BeforeSendOrderCommentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
4 changes: 2 additions & 2 deletions src/Observer/BeforeSendShipmentCommentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
8 changes: 4 additions & 4 deletions src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.0",
"autoload": {
"psr-4": {
"Fooman\\EmailAttachments\\": ""
Expand All @@ -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,
Expand Down
24 changes: 16 additions & 8 deletions src/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
<group id="order_comment">
Expand All @@ -64,7 +65,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
<group id="invoice">
Expand All @@ -90,7 +92,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
<group id="invoice_comment">
Expand All @@ -116,7 +119,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
<group id="shipment">
Expand Down Expand Up @@ -154,7 +158,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
<group id="shipment_comment">
Expand Down Expand Up @@ -192,7 +197,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
<group id="creditmemo">
Expand All @@ -218,7 +224,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
<group id="creditmemo_comment">
Expand All @@ -244,7 +251,8 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<label>Attach Terms and Conditions</label>
<tooltip><![CDATA[When set to Yes, your Terms and Conditions
(from <b>Stores &gt; Terms and Conditions</b>) will be automatically attached to the email.]]></tooltip>
(from <b>Stores &gt; Terms and Conditions</b>)
will be automatically attached to the email.]]></tooltip>
</field>
</group>
</section>
Expand Down
6 changes: 4 additions & 2 deletions src/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<plugin name="fooman_emailattachments_transportbuilder" type="Fooman\EmailAttachments\Plugin\TransportBuilder"/>
</type>
<type name="\Magento\Framework\Mail\MimeMessageInterfaceFactory">
<plugin name="fooman_emailattachments_mimemessagefactory" type="Fooman\EmailAttachments\Plugin\MimeMessageFactory"/>
<plugin name="fooman_emailattachments_mimemessagefactory"
type="Fooman\EmailAttachments\Plugin\MimeMessageFactory"/>
</type>

<!-- module introduced preferences -->
Expand Down Expand Up @@ -59,7 +60,8 @@
</arguments>
</type>

<virtualType name="fooman_emailattachments_creditmemo_pdf_renderer" type="\Fooman\EmailAttachments\Model\PdfRenderer">
<virtualType name="fooman_emailattachments_creditmemo_pdf_renderer"
type="\Fooman\EmailAttachments\Model\PdfRenderer">
<arguments>
<argument name="pdfRenderer" xsi:type="object">\Magento\Sales\Model\Order\Pdf\Creditmemo</argument>
</arguments>
Expand Down

0 comments on commit 7898633

Please sign in to comment.