Skip to content

Commit

Permalink
Merge pull request #5 from karliuka/2.4.x
Browse files Browse the repository at this point in the history
2.4.x
  • Loading branch information
karliuka authored Jan 6, 2023
2 parents 8cafa2c + 49b1b5a commit db288f2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
9 changes: 6 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: mixed-line-ending
Expand All @@ -12,11 +12,14 @@ repos:
- id: pretty-format-json
args: ["--indent=4", "--autofix", "--no-sort-keys"]
- repo: https://github.com/eriocnemis/git.MagentoPreCommitHooks
rev: 1.0.10
rev: 1.0.11
hooks:
- id: magento-xml
- id: magento-phpcs
args: ["--autofix"]
args: ["--autofix", "--php=php8.1"]
- id: magento-phpmd
args: ["--php=php8.1"]
- id: magento-phpcpd
args: ["--php=php8.1"]
- id: magento-phpstan
args: ["--php=php8.1"]
3 changes: 2 additions & 1 deletion Block/Adminhtml/Profile/Edit/Tab/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function isHidden()
*/
protected function _prepareForm()
{
/** @var \Magento\SalesSequence\Model\Profile|null $model */
$model = $this->_coreRegistry->registry('current_sequence_profile');
/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create();
Expand Down Expand Up @@ -100,7 +101,7 @@ protected function _prepareForm()
);

if ($model) {
$form->addValues($model->getData());
$form->addValues((array)$model->getData());
}
$this->setForm($form);

Expand Down
3 changes: 2 additions & 1 deletion Block/Adminhtml/Profile/Edit/Tab/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public function isHidden()
*/
protected function _prepareForm()
{
/** @var \Magento\SalesSequence\Model\Profile|null $model */
$model = $this->_coreRegistry->registry('current_sequence_profile');
/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create();
Expand Down Expand Up @@ -144,7 +145,7 @@ protected function _prepareForm()
);

if ($model) {
$form->addValues($model->getData());
$form->addValues((array)$model->getData());
}
$this->setForm($form);

Expand Down
3 changes: 2 additions & 1 deletion Block/Adminhtml/Profile/Edit/Tab/Ranges.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function isHidden()
*/
protected function _prepareForm()
{
/** @var \Magento\SalesSequence\Model\Profile|null $model */
$model = $this->_coreRegistry->registry('current_sequence_profile');
/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create();
Expand Down Expand Up @@ -116,7 +117,7 @@ protected function _prepareForm()
);

if ($model) {
$form->addValues($model->getData());
$form->addValues((array)$model->getData());
}
$this->setForm($form);

Expand Down
6 changes: 3 additions & 3 deletions Controller/Adminhtml/Sequence/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract class Profile extends Action
/**
* @var LoggerInterface
*/
private $logger;
protected $logger;

/**
* Initialize controller
Expand Down Expand Up @@ -73,8 +73,8 @@ public function __construct(
protected function initProfile()
{
$profileId = $this->getRequest()->getParam('profile_id');
if ($profileId) {
$profile = $this->profileFactory->create()->load($profileId);
if ($profileId && is_numeric($profileId)) {
$profile = $this->profileFactory->create()->load((int)$profileId);
if ($profile->getId()) {
$meta = $this->metaFactory->create()->load(
$profile->getMetaId()
Expand Down

0 comments on commit db288f2

Please sign in to comment.