Skip to content

Commit

Permalink
Merge pull request #1 from magmodules/release/1.0.1
Browse files Browse the repository at this point in the history
Release/1.0.1
  • Loading branch information
Marvin-Magmodules authored Mar 7, 2022
2 parents 1737111 + ba74fc8 commit 6c9fbe1
Show file tree
Hide file tree
Showing 24 changed files with 84 additions and 150 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Run codesniffer
run: docker run --rm --volume $(pwd)/:/app/data michielgerritsen/magento-coding-standard:latest
run:
docker run
--volume $(pwd)/:/app/workdir
michielgerritsen/magento-coding-standard:latest
--severity=6
16 changes: 15 additions & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@ jobs:
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'
dir: './'

php-80:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-81:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'
16 changes: 8 additions & 8 deletions Api/CommunicationLog/DataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,42 @@ interface DataInterface extends ExtensibleDataInterface
/**
* ID of entity
*/
const ENTITY_ID = 'entity_id';
public const ENTITY_ID = 'entity_id';

/**
* Increment ID of related entity
*/
const INCREMENT_ID = 'increment_id';
public const INCREMENT_ID = 'increment_id';

/**
* Customer's firstname
*/
const FIRSTNAME = 'firstname';
public const FIRSTNAME = 'firstname';

/**
* Customer's lastname
*/
const LASTNAME = 'lastname';
public const LASTNAME = 'lastname';

/**
* Customer's email
*/
const EMAIL = 'email';
public const EMAIL = 'email';

/**
* Entity's status
*/
const STATUS = 'status';
public const STATUS = 'status';

/**
* Type of communication event
*/
const TYPE = 'type';
public const TYPE = 'type';

/**
* Entity's creation time
*/
const CREATED_AT = 'created_at';
public const CREATED_AT = 'created_at';

/**
* Getter for entity_id
Expand Down
8 changes: 4 additions & 4 deletions Api/CommunicationLog/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ interface RepositoryInterface
/**
* Input exception text
*/
const INPUT_EXCEPTION = 'An ID is needed. Set the ID and try again.';
public const INPUT_EXCEPTION = 'An ID is needed. Set the ID and try again.';

/**
* "No such entity" exception text
*/
const NO_SUCH_ENTITY_EXCEPTION = 'The entity with id "%1" does not exist.';
public const NO_SUCH_ENTITY_EXCEPTION = 'The entity with id "%1" does not exist.';
/**
* "Could not delete" exception text
*/
const COULD_NOT_DELETE_EXCEPTION = 'Could not delete the entity: %1';
public const COULD_NOT_DELETE_EXCEPTION = 'Could not delete the entity: %1';

/**
* "Could not save" exception text
*/
const COULD_NOT_SAVE_EXCEPTION = 'Could not save the entity: %1';
public const COULD_NOT_SAVE_EXCEPTION = 'Could not save the entity: %1';

/**
* Loads a specified entity
Expand Down
58 changes: 29 additions & 29 deletions Api/Config/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,44 @@
interface RepositoryInterface
{

const EXTENSION_CODE = 'Magmodules_MessageBird';
const XML_PATH_EXTENSION_VERSION = 'magmodules_messagebird/general/version';
const ENABLED = 'magmodules_messagebird/general/enable';
const LIVE_KEY = 'magmodules_messagebird/general/api_key_live';
const TEST_KEY = 'magmodules_messagebird/general/api_key_test';
const ORIGINATOR = 'magmodules_messagebird/general/originator';
const TEST_MODE = 'magmodules_messagebird/general/test_mode';
const SENDER = 'magmodules_messagebird/general/sendername';
public const EXTENSION_CODE = 'Magmodules_MessageBird';
public const XML_PATH_EXTENSION_VERSION = 'magmodules_messagebird/general/version';
public const ENABLED = 'magmodules_messagebird/general/enable';
public const LIVE_KEY = 'magmodules_messagebird/general/api_key_live';
public const TEST_KEY = 'magmodules_messagebird/general/api_key_test';
public const ORIGINATOR = 'magmodules_messagebird/general/originator';
public const TEST_MODE = 'magmodules_messagebird/general/test_mode';
public const SENDER = 'magmodules_messagebird/general/sendername';

const ORDER = 'magmodules_messagebird/communication/order';
const ORDER_MESSAGE = 'magmodules_messagebird/communication/order_message';
public const ORDER = 'magmodules_messagebird/communication/order';
public const ORDER_MESSAGE = 'magmodules_messagebird/communication/order_message';

const INVOICE = 'magmodules_messagebird/communication/invoice';
const INVOICE_MESSAGE = 'magmodules_messagebird/communication/invoice_message';
public const INVOICE = 'magmodules_messagebird/communication/invoice';
public const INVOICE_MESSAGE = 'magmodules_messagebird/communication/invoice_message';

const SHIPPING = 'magmodules_messagebird/communication/shipment';
const SHIPPING_MESSAGE = 'magmodules_messagebird/communication/shipment_message';
public const SHIPPING = 'magmodules_messagebird/communication/shipment';
public const SHIPPING_MESSAGE = 'magmodules_messagebird/communication/shipment_message';

const CREDIT = 'magmodules_messagebird/communication/credit';
const CREDIT_MESSAGE = 'magmodules_messagebird/communication/credit_message';
public const CREDIT = 'magmodules_messagebird/communication/credit';
public const CREDIT_MESSAGE = 'magmodules_messagebird/communication/credit_message';

const OUT_OF_STOCK = 'catalog/productalert/allow_stock';
const OUT_OF_STOCK_MESSAGE = 'magmodules_messagebird/communication/out_of_stock_message';
public const OUT_OF_STOCK = 'catalog/productalert/allow_stock';
public const OUT_OF_STOCK_MESSAGE = 'magmodules_messagebird/communication/out_of_stock_message';

const PRICE_CHANGES = 'catalog/productalert/allow_price';
const PRICE_CHANGES_MESSAGE = 'magmodules_messagebird/communication/price_changes_message';
public const PRICE_CHANGES = 'catalog/productalert/allow_price';
public const PRICE_CHANGES_MESSAGE = 'magmodules_messagebird/communication/price_changes_message';

const PAYMENT_REMINDER = 'magmodules_messagebird/communication/payment_reminder';
const PAYMENT_REMINDER_MESSAGE = 'magmodules_messagebird/communication/payment_reminder_message';
const MOLLIE_STATUS = 'payment/mollie_general/enabled';
public const PAYMENT_REMINDER = 'magmodules_messagebird/communication/payment_reminder';
public const PAYMENT_REMINDER_MESSAGE = 'magmodules_messagebird/communication/payment_reminder_message';
public const MOLLIE_STATUS = 'payment/mollie_general/enabled';

const RESTRICTIONS_GENERAL = 'magmodules_messagebird/restrictions/general';
const RESTRICTIONS_ORDER = 'magmodules_messagebird/restrictions/order';
const RESTRICTIONS_INVOICE = 'magmodules_messagebird/restrictions/invoice';
const RESTRICTIONS_CREDITMEMO = 'magmodules_messagebird/restrictions/creditmemo';
const RESTRICTIONS_SHIPMENT = 'magmodules_messagebird/restrictions/shipment';
public const RESTRICTIONS_GENERAL = 'magmodules_messagebird/restrictions/general';
public const RESTRICTIONS_ORDER = 'magmodules_messagebird/restrictions/order';
public const RESTRICTIONS_INVOICE = 'magmodules_messagebird/restrictions/invoice';
public const RESTRICTIONS_CREDITMEMO = 'magmodules_messagebird/restrictions/creditmemo';
public const RESTRICTIONS_SHIPMENT = 'magmodules_messagebird/restrictions/shipment';

const DEBUG = 'magmodules_messagebird/debug/debug';
public const DEBUG = 'magmodules_messagebird/debug/debug';

/**
* Get extension version
Expand Down
76 changes: 0 additions & 76 deletions Console/Command/SendNotifications.php

This file was deleted.

2 changes: 1 addition & 1 deletion Controller/Adminhtml/Communication/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Index extends Action
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magmodules_MessageBird::communication_log_listing';
public const ADMIN_RESOURCE = 'Magmodules_MessageBird::communication_log_listing';

/**
* @var PageFactory
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Log/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Debug extends Action
/**
* Debug log file path pattern
*/
const DEBUG_LOG_FILE = '%s/log/messagebird/debug.log';
public const DEBUG_LOG_FILE = '%s/log/messagebird/debug.log';

/**
* @var JsonFactory
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Log/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Error extends Action
/**
* Error log file path pattern
*/
const ERROR_LOG_FILE = '%s/log/messagebird/error.log';
public const ERROR_LOG_FILE = '%s/log/messagebird/error.log';
/**
* @var JsonFactory
*/
Expand Down
4 changes: 2 additions & 2 deletions Logger/DebugLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function __construct(
public function addLog(string $type, $data)
{
if (is_array($data) || is_object($data)) {
$this->addDebug($type . ': ' . $this->json->serialize($data));
$this->addRecord(static::INFO, $type . ': ' . $this->json->serialize($data));
} else {
$this->addDebug($type . ': ' . $data);
$this->addRecord(static::INFO, $type . ': ' . $data);
}
}
}
4 changes: 2 additions & 2 deletions Logger/ErrorLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function __construct(
public function addLog($type, $data)
{
if (is_array($data) || is_object($data)) {
$this->addError($type . ': ' . $this->json->serialize($data));
$this->addRecord(static::ERROR, $type . ': ' . $this->json->serialize($data));
} else {
$this->addEmergency($type . ': ' . $data);
$this->addRecord(static::ERROR, $type . ': ' . $data);
}
}
}
4 changes: 2 additions & 2 deletions Model/CommunicationLog/ResourceModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class ResourceModel extends AbstractDb
/**
* Table name
*/
const ENTITY_TABLE = 'messagebird_log';
public const ENTITY_TABLE = 'messagebird_log';

/**
* Primary field
*/
const PRIMARY = 'entity_id';
public const PRIMARY = 'entity_id';

/**
* @inheritDoc
Expand Down
2 changes: 1 addition & 1 deletion Model/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
class Email extends MagentoAlertEmail
{
const ERROR = 'Product %1 notification failed: %2';
public const ERROR = 'Product %1 notification failed: %2';

/**
* @var PrepareProductAlertData
Expand Down
2 changes: 1 addition & 1 deletion Model/Source/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Status implements OptionSourceInterface
/**
* Status const
*/
const STATUSES = [
public const STATUSES = [
'Fail',
'Success'
];
Expand Down
2 changes: 1 addition & 1 deletion Model/Source/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Type implements OptionSourceInterface
/**
* Type const
*/
const TYPES =
public const TYPES =
[
'Creditmemo',
'Invoice',
Expand Down
2 changes: 1 addition & 1 deletion Observer/Creditmemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class Creditmemo implements ObserverInterface
{
const ERROR = 'Processing of creditmemo ID %1 for order %2 failed: %3';
public const ERROR = 'Processing of creditmemo ID %1 for order %2 failed: %3';

/**
* @var Adapter
Expand Down
2 changes: 1 addition & 1 deletion Observer/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class Invoice implements ObserverInterface
{
const ERROR = 'Processing of invoice ID %1 for order %2 failed: %3';
public const ERROR = 'Processing of invoice ID %1 for order %2 failed: %3';

/**
* @var Adapter
Expand Down
2 changes: 1 addition & 1 deletion Observer/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class Order implements ObserverInterface
{
const ERROR = 'Processing of order ID %1 failed: %2';
public const ERROR = 'Processing of order ID %1 failed: %2';

/**
* @var Adapter
Expand Down
2 changes: 1 addition & 1 deletion Observer/PaymentReminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class PaymentReminder implements ObserverInterface
{
const ERROR = 'Processing of payment reminding for order ID %1 failed: %2';
public const ERROR = 'Processing of payment reminding for order ID %1 failed: %2';

/**
* @var Adapter
Expand Down
Loading

0 comments on commit 6c9fbe1

Please sign in to comment.