Skip to content

Commit

Permalink
Resolve dynamic property deprecation error for PHP 8.2 and 8.3 (#485)
Browse files Browse the repository at this point in the history
* Add AllowDynamicProperties attribute to resolve deprecation error for dynamic property.

* Update omise-php version

* Add AllowDynamicProperties in Model/Data/Email.php file.

* Add AllowDynamicProperties to some more files.
  • Loading branch information
aashishgurung authored Jul 24, 2024
1 parent d936ae8 commit 46b8506
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions Block/Adminhtml/System/Config/Fieldset/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/**
* Fieldset renderer for Omise solution
*/
#[\AllowDynamicProperties]
class Payment extends \Magento\Config\Block\System\Config\Form\Fieldset
{
/**
Expand Down
1 change: 1 addition & 0 deletions Block/Adminhtml/System/Config/Form/Field/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\App\Request\Http;

#[\AllowDynamicProperties]
class Webhook extends Field
{
/**
Expand Down
1 change: 1 addition & 0 deletions Block/Checkout/Onepage/Success/AdditionalInformation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Omise\Payment\Block\Checkout\Onepage\Success;

#[\AllowDynamicProperties]
class AdditionalInformation extends \Magento\Framework\View\Element\Template
{
/**
Expand Down
1 change: 1 addition & 0 deletions Controller/Adminhtml/Ordersync/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Omise\Payment\Helper\OmiseHelper as Helper;
use Omise\Payment\Model\SyncStatus;

#[\AllowDynamicProperties]
class Index extends \Magento\Backend\App\Action
{
/**
Expand Down
1 change: 1 addition & 0 deletions Controller/Callback/Offsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Psr\Log\LoggerInterface;
use Magento\Framework\App\Request\Http;

#[\AllowDynamicProperties]
class Offsite extends Action
{
/**
Expand Down
1 change: 1 addition & 0 deletions Controller/Callback/Threedsecure.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Psr\Log\LoggerInterface;
use Magento\Framework\App\Request\Http;

#[\AllowDynamicProperties]
class Threedsecure extends Action
{
/**
Expand Down
1 change: 1 addition & 0 deletions Controller/Cards/DeleteAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use Magento\Framework\App\Request\Http;

#[\AllowDynamicProperties]
class DeleteAction extends \Magento\Framework\App\Action\Action
{
const WRONG_REQUEST = 1;
Expand Down
1 change: 1 addition & 0 deletions Controller/Cards/ListAction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Omise\Payment\Controller\Cards;

#[\AllowDynamicProperties]
class ListAction extends \Magento\Framework\App\Action\Action
{
/**
Expand Down
1 change: 1 addition & 0 deletions Controller/Payment/Complete.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Omise\Payment\Controller\Payment;

#[\AllowDynamicProperties]
class Complete extends \Magento\Framework\App\Action\Action
{
/**
Expand Down
1 change: 1 addition & 0 deletions Cron/OrderSyncStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Magento\Framework\App\Config\ScopeConfigInterface;
use Exception;

#[\AllowDynamicProperties]
class OrderSyncStatus
{
/**
Expand Down
1 change: 1 addition & 0 deletions Helper/ReturnUrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Omise\Payment\Helper\TokenHelper;
use Magento\Framework\UrlInterface;

#[\AllowDynamicProperties]
class ReturnUrlHelper
{
public function __construct(UrlInterface $url, TokenHelper $tokenHelper)
Expand Down
1 change: 1 addition & 0 deletions Model/Api/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use OmiseCustomer;
use Omise\Payment\Model\Config\Config;

#[\AllowDynamicProperties]
class Customer extends BaseObject
{
/**
Expand Down
1 change: 1 addition & 0 deletions Model/Api/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property Object $data
* @see https://www.omise.co/events-api
*/
#[\AllowDynamicProperties]
class Event extends BaseObject
{
/**
Expand Down
1 change: 1 addition & 0 deletions Model/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Magento\Store\Model\StoreManagerInterface;
use Magento\Sales\Model\Order;

#[\AllowDynamicProperties]
class Config
{
/**
Expand Down
1 change: 1 addition & 0 deletions Model/Data/Email.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Omise\Payment\Model\Data;

#[\AllowDynamicProperties]
class Email
{
/**
Expand Down
1 change: 1 addition & 0 deletions Model/RefundSyncStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Omise\Payment\Service\CreditMemoService;
use Magento\Sales\Model\Order;

#[\AllowDynamicProperties]
class RefundSyncStatus
{
public function __construct(CreditMemoService $creditMemoService)
Expand Down
1 change: 1 addition & 0 deletions Model/SyncStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Omise\Payment\Model\Config\Cc as Config;
use Omise\Payment\Model\RefundSyncStatus;

#[\AllowDynamicProperties]
class SyncStatus
{
const STATUS_SUCCESSFUL = 'successful';
Expand Down
1 change: 1 addition & 0 deletions Observer/WebhookObserver/WebhookObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Omise\Payment\Model\Config\Config;
use Omise\Payment\Model\Api\Charge as ApiCharge;

#[\AllowDynamicProperties]
abstract class WebhookObserver implements ObserverInterface
{
/**
Expand Down
1 change: 1 addition & 0 deletions Plugin/ConfigSectionPaymentPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Magento\Framework\App\Config\ScopeConfigInterface;
use Exception;

#[\AllowDynamicProperties]
class ConfigSectionPaymentPlugin
{

Expand Down
1 change: 1 addition & 0 deletions Service/CreditMemoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Magento\Sales\Model\Order\Invoice;
use Magento\Sales\Model\Service\CreditmemoService as MagentoCreditmemoService;

#[\AllowDynamicProperties]
class CreditMemoService
{
/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"require": {
"php": ">=5.6",
"magento/magento-composer-installer": ">=0.3.0",
"omise/omise-php": "2.16.1"
"omise/omise-php": "2.18.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^9.5",
Expand Down

0 comments on commit 46b8506

Please sign in to comment.